Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Determining a Broker's Daylight Saving Time (DST) Timetable - MetaTrader 5 Script - MT4/MT5 Resources

author EAcpu | 2 reads | 0 comments |

Script to determine if your broker follows the US, UK or Australian Daylight Saving Time (DST) schedule.

The script scans the H1 chart bars of the current chart for daylight changes on the expected date, and by comparing changes in the server (bar) time of these bars, it can determine the broker's DST schedule.

The algorithm is simple and fast. Furthermore, it works fine in the strategy tester because it does not rely on price reaction to economic calendar events (like other algorithms).

DST_AU schedule:

DST_UK timetable:

DST_US schedule:

DST_NONE schedule:

Example output after running the script on different Forex brokers:

 /*
 Server: Exness-MT5 trial version time: 2024.03.13 12:25:13
 Offset: GMT+0
 Daylight Saving Time_None*/

Another agent:

 /*
 Server: OctaFX - Demo Time: 2024.03.14 00:27:05
 Offset: GMT+2
 DST_UK: The server dst starts on the last Sunday in March (+1) and ends on the last Sunday in October (-1)*/

Third broker:

 /*
 Server: ICMarketsSC - Demo time: 2024.03.14 01:42:54
 Offset: GMT+3
 DST_US: The server dst starts on the second Sunday in March (+1) and ends on the first Sunday in November (-1)*/



Attachment download

📎 brokerdaylightschedule.mq5 (15.75 KB)

Source: MQL5 #48650

Verification code Refresh