TradingView
TestedFX
22 Th09 2020 20:24

Forex Session Breaks DST AWARE! 

Canadian Dollar/Japanese YenFXCM

Mô tả

There seems to be no open source forex trading session DST (Daylight Savings Time) aware scripts which I think is absurd. This amazing community deserves better. So I adapted some code by icostan adding DST capabilities.

Original code by icostan here tradingview.com/script/f7NaHBPa-Session-breaks/
I added DST code. Warning may not be perfect yet. Could be a bug or two. It only supports 3 major sessions right now but you can add your own rules for the other timezones by copying my logic.

It is open source so please add the other sessions and regions as needed and update me please.
Bình luận
Christian_1605
this is form a script that i know, maybe this logic can help you out to make it work perfectly.. :-) if month < 3 or month > 11
nyDST := false
ukDST := false
sydDST := true
else if month > 4 and month < 10
nyDST := true
ukDST := true
sydDST := false
else if month == 3
nyDST := previousSunday >= 8
ukDST := previousSunday >= 24
sydDST := true
else if month == 4
nyDST := true
ukDST := true
sydDST := previousSunday <= 0
else if month == 10
nyDST := true
ukDST := previousSunday <= 24
sydDST := previousSunday >= 0
else // month == 11
nyDST := previousSunday <= 0
ukDST := false
sydDST := true
KKirito
Hi mate. Just to let you know, 45m has some weird bug, only NY session appears. Any thoughts ?
KKirito
Yeah nice job. I wanted a clean line session identifier which had DST. Since we just went forward.
Thêm nữa