Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=3
- study("Session Markers by JustUncleL",overlay=true)
- //
- // --- Default Sessions times relative to FXCM or OANDA (NY) Data source.
- auto = input(true, title="Use Automatic Time Zones")
- Summer = input(false, title="New York Summer")
- ssd = input("1700-1705",type=session,title="Sydney Start Time")
- sty = input("1800-1801",type=session,title="Asia Start Time")
- sln = input("0300-0301",type=session,title="Europe Start Time")
- sny = input("0800-0801",type=session,title="NewYork Start Time")
- stt = input("0200-1200",type=session,title="Trading Time Frame")
- // Test valid time for current candle
- timeinrange(res, sess) =>
- s = isintraday and interval <=60 ? true : false
- time(res, sess) != 0 and s
- //Sydney
- Sydney = auto? Summer? "1800-1805" : "1600-1605" : ssd // Server Change Day Time, it closes to two minutes.
- SydneyColor = aqua
- bgcolor(timeinrange(period, Sydney) ? SydneyColor : na, transp=80, title="Sydney Start")
- plotchar(timeinrange(period, Sydney)? true:na, char='S',color=black,transp=0,location=location.bottom)
- //Tokyo
- Tokyo = auto? Summer? "1900-1901" : "1800-1801" : sty
- TokyoColor = blue
- bgcolor(timeinrange(period, Tokyo) ? TokyoColor : na, transp=90, title="Tokyo Start")
- plotchar(timeinrange(period, Tokyo)? true:na, char='T',color=black,transp=0,location=location.bottom)
- //London
- London = auto? "0300-0301" : sln
- LondonColor = green
- bgcolor(timeinrange(period, London) ? LondonColor : na, transp=90, title="London Start")
- plotchar(timeinrange(period, London)? true:na, char='L',color=black,transp=0,location=location.bottom)
- //New York
- NewYork = auto ? "0800-0801" : sny
- NewYorkColor = red
- bgcolor(timeinrange(period, NewYork) ? NewYorkColor : na, transp=90, title="NewYork Start")
- plotchar(timeinrange(period, NewYork)? true:na, char='N',color=black,transp=0,location=location.bottom)
- TradingTime = auto?"0200-1200" : stt
- TradingTimeColor = black
- bgcolor(timeinrange(period, TradingTime) ? TradingTimeColor : na, transp=90, title="TradingTime")
- //plotchar(timeinrange(period, LNewYork)? true:na, char='N',color=black,transp=0,location=location.bottom)
- //eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement