ORB-5Min

foraus · study · 21 行 · 点赞 766 · TradingView 原页

本页源码来自 TradingView 公开发布的开源脚本,版权归原作者所有, 请遵循其原始许可(Pine 脚本常见 CC BY-NC-SA / MPL-2.0 / MIT)。 本项目仅用于研究检索与许可范围内的移植。

Pine Script

study(title="ORB-5Min", shorttitle="ORB5", overlay=true)
 
up5on   = input(true, title="5 Minute Opening Range High")
down5on = input(true, title="5 Minute Opening Range Low")
 
is_newbar(res) =>
    t = time(res, "0930-1430")
    not na(t) and (na(t[1]) or t > t[1])
   
adopt(r, s) => security(tickerid, r, s)
 
high_range  = valuewhen(is_newbar('D'), high, 0)
low_range   = valuewhen(is_newbar('D'), low,  0)
high_rangeL = valuewhen(is_newbar('D'), high, 0)
low_rangeL  = valuewhen(is_newbar('D'), low,  0)
 
up5   = plot(up5on   ? adopt('5', high_rangeL): na, color = #53cbe9, style=line, linewidth=1)
down5 = plot(down5on ? adopt('5', low_rangeL) : na, color = #e97d53, style=line, linewidth=1)
 
trans = up5on ?  97 : 100
fill(up5, down5, color = white, transp=trans)

← 返回列表