Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=4
- //Automating session ranges to make my life easier.
- study("Immaculate Session Ranges", overlay=true)
- timeIsAllowedMorn = time(timeframe.period, "0930-1005:23456")
- var hiMorn = 10e-10
- var loMorn = 10e10
- if timeIsAllowedMorn
- if not timeIsAllowedMorn[1]
- hiMorn := high
- loMorn := low
- else
- hiMorn := max(high, hiMorn)
- loMorn := min(low, loMorn)
- timeIsAllowedAft = time(timeframe.period, "1330-1405:23456")
- var hiAft = 10e-10
- var loAft = 10e10
- if timeIsAllowedAft
- if not timeIsAllowedAft[1]
- hiAft := high
- loAft := low
- else
- hiAft := max(high, hiAft)
- loAft := min(low, loAft)
- plot(not(true and not time(timeframe.period, "0930-1330:23456"))? hiMorn : na, "Morning High", color.blue, 3, plot.style_circles)
- plot(not(true and not time(timeframe.period, "0930-1330:23456"))? loMorn : na, "Morning Low", color.fuchsia, 3, plot.style_circles)
- plot(not(true and not time(timeframe.period, "1330-1600:23456"))? hiAft : na, "Afternoon High", color.blue, 3, plot.style_circles)
- 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