需要帮助转换为pine脚本的版本4

时间:2019-12-12 05:23:48

标签: algorithmic-trading trading pine-script

以下代码可帮助客栈找到用户提到的初始范围的高值和低值。

study(title="Initial Range", shorttitle="IR", overlay=true)

ir = input(true, title="Show Initial Range") 
res = input('60', type=resolution, title="Duration of Initial Range")
SessionTiming = input("0915-1530", type=session)
sessToUse= SessionTiming
bartimeSess = time('D', sessToUse)
fr2to17 = time(period, sessToUse)

is_newbar(res) => change(time(res, sessToUse)) != 0

adopt(r, s) => security(tickerid, r, s)
high_range = valuewhen(is_newbar('D'),high,0)

low_range = valuewhen(is_newbar('D'),low,0)
plot( fr2to17>0 and isintraday and ir ? adopt(res, high_range): na, title="High", style=circles,color=#FF7F00, transp=0)

plot( fr2to17>0 and isintraday and ir ? adopt(res, low_range): na, title="Low", style=circles,color=#FF7F00, transp=0)

0 个答案:

没有答案