Simple indicator showing market hours for New York, London, Sydney and Tokyo. It plots 60 bars in future so you can easily see when certain sessions start or end before it happens.
x = gap between plots (adjustable)
x = gap between plots (adjustable)
study(title="Market Hours [TMC]", shorttitle="Market Hours", overlay=false) // inputs show4=input(true, title="Show London?") show3=input(true, title="Show New York?") show2=input(true, title="Show Sydney?") show1=input(true, title="Show Tokyo?") x=input(0.22, step=0.01) // times London="0201-1100", NewYork="0701-1600", Sydney="1601-0100", Tokyo="1801-0300" timeinrange(res,sess)=>time(res,sess)!=0 // plots london=show4?(timeinrange(period,London)?4-x:3):na newyork=show3?(timeinrange(period,NewYork)?3-x:2):na sydney=show2?(timeinrange(period,Sydney)?2-x:1):na tokyo=show1?(timeinrange(period,Tokyo)?1-x:0):na //plot(7, color=white) LondonHours=plot(london, color=#3FA9F5, style=histogram, histbase=3, linewidth=8, offset=60) NewYorkHours=plot(newyork, color=#ED1E79, style=histogram, histbase=2, linewidth=8, offset=60) SydneyHours=plot(sydney, color=#79C942, style=histogram, histbase=1, linewidth=8, offset=60) TokyoHours=plot(tokyo, color=#FF931E, style=histogram, histbase=0, linewidth=8, offset=60) //plot(4, color=white, offset=60) //plot(3, color=white, offset=60) //plot(2, color=white, offset=60) //plot(1, color=white, offset=60) //plot(0, color=white, offset=60)