When daylight saving time breaks your EA
Posted: Mon Oct 26, 2026 9:44 pm
Twice a year, many EAs quietly trade at the wrong time. The US and Europe change clocks on different dates, and broker server time often follows New York close (GMT+2/+3), so there are weeks when everything shifts by an hour relative to each other.
Things that broke in my EAs over the years:
Things that broke in my EAs over the years:
- Session filters in server time. A "London open" filter hard-coded to 10:00 server time was wrong for two to three weeks each spring and autumn.
- News times. Calendar in UTC, EA in server time, conversion done with a fixed offset.
- Daily candles. The day boundary moved, so "yesterday's high" referred to a slightly different period.
- Backtests. Historical data in one convention, filters in another.
- All time logic in UTC inside the EA. Convert server time to UTC with an offset calculated from TimeTradeServer() and TimeGMT(), not hard-coded.
- Session times defined in local time of the market (London, New York) and converted with proper DST rules.
- A log line every Monday printing the calculated offsets, so I can check them quickly.