Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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)
Advertisement
Add Comment
Please, Sign In to add comment