gpt4 book ai didi

time(timeframe.period, " ") bug? Plots wrong time for initial balance(Time(TimeFrame.Period,“”)错误?绘制初始平衡的错误时间)

转载 作者:bug小助手 更新时间:2023-10-25 13:30:14 29 4
gpt4 key购买 nike



Here is my code. I want to plot the 9:30-10AM EST high and low. I hacked together this code, but I am confused on the time. It only works if I set it as 0800-0900, which doesn't make any sense. It breaks if I set it as 0930-1000.

这是我的代码。我想绘制美国东部夏令时9:30-10点的最高点和最低点。我破解了这个代码,但我搞不清时间了。只有当我将其设置为0800-0900时才有效,这没有任何意义。如果我把它设置为0930-1000,它就断了。


// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
//@version=4

study(title="my IB ext", shorttitle="my IB ext", overlay=true)

//Session Rules
bartimeSess = time(timeframe.period, "0930-1000:23456")
newbarSess = bartimeSess != bartimeSess[1]
high_range = valuewhen(newbarSess,high,0)
low_range = valuewhen(newbarSess,low,0)

//Calcul For Opening Range
locHigh = security(syminfo.tickerid, "30", high_range)
locLow = security(syminfo.tickerid, "30", low_range)
range = locHigh - locLow


//Plot Statements For Initial Balance
pLo = plot(time(timeframe.period) > 0 ? locLow : na,title="IB Low", color=color.rgb(255,0,0,75), linewidth=1, style = plot.style_stepline)
p50 = plot(locLow + (.5*range),title="IB Medium", color=color.rgb(255,255,0,75), linewidth=1, style = plot.style_stepline)
pHi = plot(time(timeframe.period) > 0 ? locHigh : na,title="IB High", color=color.rgb(255,0,0,75), linewidth=1, style = plot.style_stepline)

I want to plot the initial balance, but the time that is plotted doesn't correspond to the time I've listed in the arguments.

我想绘制初始余额,但绘制的时间与我在参数中列出的时间不一致。


更多回答
优秀答案推荐
更多回答

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com