xmd79

ORB-5Min

Nov 28th, 2022
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. study(title="ORB-5Min", shorttitle="ORB5", overlay=true)
  2.  
  3. up5on = input(true, title="5 Minute Opening Range High")
  4. down5on = input(true, title="5 Minute Opening Range Low")
  5.  
  6. is_newbar(res) =>
  7. t = time(res, "0930-1430")
  8. not na(t) and (na(t[1]) or t > t[1])
  9.  
  10. adopt(r, s) => security(tickerid, r, s)
  11.  
  12. high_range = valuewhen(is_newbar('D'), high, 0)
  13. low_range = valuewhen(is_newbar('D'), low, 0)
  14. high_rangeL = valuewhen(is_newbar('D'), high, 0)
  15. low_rangeL = valuewhen(is_newbar('D'), low, 0)
  16.  
  17. up5 = plot(up5on ? adopt('5', high_rangeL): na, color = #53cbe9, style=line, linewidth=1)
  18. down5 = plot(down5on ? adopt('5', low_rangeL) : na, color = #e97d53, style=line, linewidth=1)
  19.  
  20. trans = up5on ? 97 : 100
  21. fill(up5, down5, color = white, transp=trans)
Advertisement
Add Comment
Please, Sign In to add comment