Advertisement
JustUncleL

Session Markers by JustUncleL

Nov 30th, 2017
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. //@version=3
  2. study("Session Markers by JustUncleL",overlay=true)
  3.  
  4. //
  5. // --- Default Sessions times relative to FXCM or OANDA (NY) Data source.
  6. auto = input(true, title="Use Automatic Time Zones")
  7. Summer = input(false, title="New York Summer")
  8. ssd = input("1700-1705",type=session,title="Sydney Start Time")
  9. sty = input("1800-1801",type=session,title="Asia Start Time")
  10. sln = input("0300-0301",type=session,title="Europe Start Time")
  11. sny = input("0800-0801",type=session,title="NewYork Start Time")
  12. stt = input("0200-1200",type=session,title="Trading Time Frame")
  13.  
  14.  
  15. // Test valid time for current candle
  16. timeinrange(res, sess) =>
  17. s = isintraday and interval <=60 ? true : false
  18. time(res, sess) != 0 and s
  19.  
  20. //Sydney
  21. Sydney = auto? Summer? "1800-1805" : "1600-1605" : ssd // Server Change Day Time, it closes to two minutes.
  22. SydneyColor = aqua
  23. bgcolor(timeinrange(period, Sydney) ? SydneyColor : na, transp=80, title="Sydney Start")
  24. plotchar(timeinrange(period, Sydney)? true:na, char='S',color=black,transp=0,location=location.bottom)
  25.  
  26. //Tokyo
  27. Tokyo = auto? Summer? "1900-1901" : "1800-1801" : sty
  28. TokyoColor = blue
  29. bgcolor(timeinrange(period, Tokyo) ? TokyoColor : na, transp=90, title="Tokyo Start")
  30. plotchar(timeinrange(period, Tokyo)? true:na, char='T',color=black,transp=0,location=location.bottom)
  31.  
  32. //London
  33. London = auto? "0300-0301" : sln
  34. LondonColor = green
  35. bgcolor(timeinrange(period, London) ? LondonColor : na, transp=90, title="London Start")
  36. plotchar(timeinrange(period, London)? true:na, char='L',color=black,transp=0,location=location.bottom)
  37.  
  38. //New York
  39. NewYork = auto ? "0800-0801" : sny
  40. NewYorkColor = red
  41. bgcolor(timeinrange(period, NewYork) ? NewYorkColor : na, transp=90, title="NewYork Start")
  42. plotchar(timeinrange(period, NewYork)? true:na, char='N',color=black,transp=0,location=location.bottom)
  43.  
  44. TradingTime = auto?"0200-1200" : stt
  45. TradingTimeColor = black
  46. bgcolor(timeinrange(period, TradingTime) ? TradingTimeColor : na, transp=90, title="TradingTime")
  47. //plotchar(timeinrange(period, LNewYork)? true:na, char='N',color=black,transp=0,location=location.bottom)
  48.  
  49.  
  50.  
  51. //eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement