Scripts: Determine Broker's Daylight (DST) schedule - page 4

 
Joe #:

Am testing the script on the server "Exness-MT5Real9" and yesterday(9th March 2025), the US forwarded clocks for DST but the Exness MT5 platform time remained the same(GMT+0). I though the script would return DST_NONE however I got DST_US, am I missing something here?

On which symbol?
 
amrali #:
I did not find a broker following DST_AU.
Server : RannForex-Server
Time : 2026.08.04 16:14:30 Offset : GMT+3 Symbol : EURUSD DST_AU : server dst begins on the first Sunday of October (+1) and ends on the first Sunday of April (-1) Server : RannForex-Server Time : 2026.08.04 16:13:34 Offset : GMT+3 Sumbol : XAUUSD DST_US : server dst begins on the second Sunday of March (+1) and ends on the first Sunday of November (-1)

As it turns out, the DST can differ per symbol with the same broker. Not sure if this is correct or a bug. These timezone / DST issues make my brain hurt.

 
Enrique Dangeroux #:

As it turns out, the DST can differ per symbol with the same broker. Not sure if this is correct or a bug. These timezone / DST issues make my brain hurt.
PS, this is when running the code on XAUUSD. That is, both outputs are from a XAUSUD chart, where for the second output i forced GetReferenceSymbol to EURUSD.
 
Enrique Dangeroux #:
PS, this is when running the code on XAUUSD. That is, both outputs are from a XAUSUD chart, where for the second output i forced GetReferenceSymbol to EURUSD.
Yes, I believe this is a broker-side issue. The fact that DST handling can differ between symbols under the same broker, resulting in inconsistent chart times, suggests that the broker is using different session/timezone configurations rather than a consistent DST rule. This makes the chart timestamps unreliable and unnecessarily difficult to interpret.

 
Thank you for sharing this excellent work with the MQL5 community. Your DetectBrokerDST implementation provided a very useful and practical solution to a problem that is surprisingly difficult to handle reliably in MetaTrader. I used your approach as a reference while developing a reusable session-handling component, particularly for correctly dealing with broker DST during historical testing. Having a proven implementation to study saved a great deal of unnecessary trial and error. I really appreciate the time and effort you put into developing this and making the source available for others to learn from and build upon. Excellent contribution to the community. Thank you!