Advertisement
TheLark

TradingView: Timed range with breakouts

May 16th, 2014
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. study(title = "The Lark: Timed Range w/ Breakouts", overlay=true)
  2.  
  3. ////// CHANGE THESE FOR YOUR PREFERED OPEN AND CLOSE RANGE //////
  4. Range = "0400-0800"
  5. // MinutesOpen calculates the bars back for hh and ll,
  6. // enter the amount of minutes the range above is.
  7. MinutesOpen = 60 * 4
  8. ////////////////////////////////////////////////////////////////
  9.  
  10. range(res,ses) => time(res, ses) != 0
  11. ors = range("1", Range)
  12. mino = MinutesOpen / interval
  13. hh = ors ? highest(mino) : hh[1]
  14. ll = ors ? lowest(mino) : ll[1]
  15. col1 = close[2] < hh and open > hh and open < close[1] ? #FF00DC : open > hh ? #6ABF23 : white
  16. col2 = close[2] > ll and open < ll and open > close[1] ? #FF00DC : close < ll ? #6ABF23 : white
  17. plot(ors ? na:hh,color=col1,style=circles,linewidth=2)
  18. plot(ors ? na:ll,color=col2,style=circles,linewidth=2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement