Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=4
- //
- // Modified from @Lothalin's OM Session Ranges script
- //
- // This version displays tickers that use the Central Timezon, such as VIX
- study("Vet Session Ranges", overlay=true)
- central = (syminfo.timezone == "America/Chicago")
- timeIsAllowedMorn = time(timeframe.period,(central ? "0830-0905:23456":"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,(central ? "1230-1305:23456":"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,(central ? "0830-1230:23456":"0930-1330:23456")))? hiMorn : na, "Morning High", color.rgb(0,255,0,0), 2, plot.style_circles)
- plot(not(true and not time(timeframe.period,(central ? "0830-1230:23456":"0930-1330:23456")))? loMorn : na, "Morning Low", color.rgb(255,0,0,0), 2, plot.style_circles)
- plot(not(true and not time(timeframe.period,(central ? "1230-1500:23456":"1330-1600:23456")))? hiAft : na, "Afternoon High", color.rgb(0,255,0,0), 2, plot.style_circles)
- plot(not(true and not time(timeframe.period,(central ? "1230-1500:23456":"1330-1600:23456")))? loAft : na, "Afternoon Low", color.rgb(255,0,0,0), 2, plot.style_circles)
Advertisement
Add Comment
Please, Sign In to add comment