xmd79

Immaculate Session Ranges

Oct 14th, 2021
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. //@version=4
  2. //Automating session ranges to make my life easier.
  3. study("Immaculate Session Ranges", overlay=true)
  4.  
  5. timeIsAllowedMorn = time(timeframe.period, "0930-1005:23456")
  6. var hiMorn = 10e-10
  7. var loMorn = 10e10
  8. if timeIsAllowedMorn
  9. if not timeIsAllowedMorn[1]
  10. hiMorn := high
  11. loMorn := low
  12. else
  13. hiMorn := max(high, hiMorn)
  14. loMorn := min(low, loMorn)
  15.  
  16.  
  17. timeIsAllowedAft = time(timeframe.period, "1330-1405:23456")
  18. var hiAft = 10e-10
  19. var loAft = 10e10
  20. if timeIsAllowedAft
  21. if not timeIsAllowedAft[1]
  22. hiAft := high
  23. loAft := low
  24. else
  25. hiAft := max(high, hiAft)
  26. loAft := min(low, loAft)
  27.  
  28.  
  29. plot(not(true and not time(timeframe.period, "0930-1330:23456"))? hiMorn : na, "Morning High", color.blue, 3, plot.style_circles)
  30. plot(not(true and not time(timeframe.period, "0930-1330:23456"))? loMorn : na, "Morning Low", color.fuchsia, 3, plot.style_circles)
  31. plot(not(true and not time(timeframe.period, "1330-1600:23456"))? hiAft : na, "Afternoon High", color.blue, 3, plot.style_circles)
  32. plot(not(true and not time(timeframe.period, "1330-1600:23456"))? loAft : na, "Afternoon Low", color.fuchsia, 3, plot.style_circles)
Advertisement
Add Comment
Please, Sign In to add comment