Why DST Shifts Your EA's Trading Hours and the Fix
Contents (6)
- Bottom line: decide "which city's clock," not just "what time"
- Why the shift happens twice a year
- There are four clocks
- What does "15:00 to 18:00 server time" mean?
- The US and Europe switch on different dates
- Implementation that absorbs the shift
- 1. Convert to UTC internally before making decisions
- 2. Measure the offset in live operation
- 3. Calculate from rules in backtests
- What to check on your side
- Limits and cautions
- Summary
Contents
- Bottom line: decide "which city's clock," not just "what time"
- Why the shift happens twice a year
- There are four clocks
- What does "15:00 to 18:00 server time" mean?
- The US and Europe switch on different dates
- Implementation that absorbs the shift
- 1. Convert to UTC internally before making decisions
- 2. Measure the offset in live operation
- 3. Calculate from rules in backtests
- What to check on your side
- Limits and cautions
- Summary
Bottom line: decide "which city's clock," not just "what time"
An EA that restricts trading to certain hours can drift by one hour when it crosses a daylight saving time (DST) changeover. The cause is not the EA itself but the reference clock it uses to keep time.
Here is the conclusion up front.
- First check which reference your EA's time setting uses: MT5 server time, UTC, Japan time, or local time in London or New York
- The shift happens because the gaps between those references change twice a year
- An implementation can absorb it. But automatic detection is not possible in backtests, and the US and Europe switch on different dates, so the shift cannot be eliminated completely
We covered the differences in time zones between servers in a separate article. This article focuses only on the "seasonal shift" that happens twice a year, even with the same broker.
Recommended Broker Comparison →
🎁 Download Free EA📧 Free 8-email course + subscriber-only pack of 13 MT5 indicators
* Privacy strictly protected. You can unsubscribe at any time.
Why the shift happens twice a year
There are four clocks
The clocks involved in a time filter are mainly these four.
| Clock | Affected by DST | Notes |
|---|---|---|
| UTC | No | The global standard |
| Japan time (JST) | No | Always UTC+9 |
| MT5 server time | Depends on the broker | Many brokers switch between UTC+2 and UTC+3 for winter and summer |
| Local time in London / New York | Yes | The clock market participants actually act on |
Many brokers set their clocks so that 17:00 in New York is 0:00 server time. As a result, the gap between server time and UTC also changes in step with US daylight saving time.
What does "15:00 to 18:00 server time" mean?
Suppose an EA's settings say "start 15:00, end 18:00" and this is server time. During a period when server time and the market's clock move together, the meaning from the market's point of view does not change. Seen in Japan time, however, it shifts by one hour between summer and winter.
Conversely, if the EA keeps time in Japan time or UTC, this happens: a "from 16:00" fixed in Japan time can be early morning or mid-morning for London traders, depending on whether London is on summer time. Whichever reference you fix to, it will inevitably drift from the other clocks. It cannot be avoided, so you need to choose which clock to align with.
The US and Europe switch on different dates
In the US, DST runs from the second Sunday of March to the first Sunday of November. In Europe, it runs from the last Sunday of March to the last Sunday of October. So there are two to three weeks in spring and about one week in autumn when the London-New York time difference is one hour off from the usual. This year (2026), Europe returned to winter time on October 25 and the US on November 1. If you set an EA that targets London time using NY-based server time, it will drift only during this window.
Implementation that absorbs the shift
This is how we approach building EAs.
1. Convert to UTC internally before making decisions
The time the user enters is taken as local time that serves as the strategy's reference, such as London time. At decision time, server time is converted to UTC, then to the reference local time, and only then compared. This way the meaning stays the same whether you change brokers or the season changes.
2. Measure the offset in live operation
In a running MT5, TimeTradeServer() - TimeGMT() gives the difference between server time and UTC. It is measured on the spot rather than relying on manual input.
3. Calculate from rules in backtests
Here is the pitfall. In the MT5 Strategy Tester, TimeGMT() returns the same value as the server time inside the tester, so the difference cannot be measured. So we make "this broker uses / does not use US-style DST" an input parameter and calculate the changeover dates from the calendar.
// Check for US-style DST (second Sunday of March to first Sunday of November). Simplified version
bool IsUsDst(datetime t){
MqlDateTime d; TimeToStruct(t,d);
if(d.mon<3 || d.mon>11) return false;
if(d.mon>3 && d.mon<11) return true;
int firstSun = 1 + (7 - DayOfWeekOf(d.year,d.mon,1)) % 7;
if(d.mon==3) return d.day >= firstSun+7;
return d.day < firstSun;
}
This is a day-level simplified version. In practice, the handling of the changeover time is also included.
What to check on your side
- Check the EA's manual or the names of its input fields to find out which time reference it uses (if it is not stated, ask the distributor)
- Note the difference between the time shown in MT5's Market Watch and Japan time, in both summer and winter
- During the changeover weeks in March and October to November, check the trade history to confirm that entry times are as intended
- When switching brokers, check how that broker handles DST (compare them in the broker comparison)
- The VPS operating system clock is often not used for the EA's decisions, but set it correctly anyway to avoid misreading logs (VPS information)
The basics of the input fields are covered in how to set up an EA.
Limits and cautions
- Brokers' DST rules are sometimes not published, and there are past cases where they changed. If you apply today's rule to a backtest over an older period, some stretches may be off. We have not verified every broker over every period.
- During the weeks when the US and Europe switch on different dates, you will be off from one of the two markets whichever reference you align to. It cannot be absorbed; you can only choose which one to prioritize.
- Converting times correctly does not guarantee that performance holds up. The hours when markets overlap and the liquidity both differ between summer and winter. Whether a time window that worked in winter works equally well in summer needs separate validation.
- Right before and after a changeover, the broker's spreads and rollover times also move. Performance can get erratic only during this period.
Summary
- The DST shift occurs because the gaps among server time, UTC, Japan time and local time change twice a year
- Start setting an EA's trading hours by confirming "what time on which clock"
- In implementation, handle everything internally in UTC, measure the offset in live operation, and calculate from rules in backtests
- The weeks when US and European changeovers differ, and past periods when the broker's rules are unknown, cannot be fully absorbed
- During changeover weeks, check entry times by eye in the trade history
Other points to watch when running MT5 are collected in EA and MT5 know-how.
Related
2026-11-16
EA Weekend Holding Risk and Friday Close Design
2026-11-14
Aurum AI mt5 Review: PF 0.87, 95.7% DD over 11.5 Years
2026-11-14
Gold House MT5 Review: PF 2.93, 1.1% DD over 11.5 Years
2026-11-14
GOLD Scalper PRO MT5 Review: PF 1.33, 12.8% DD over 11.5 Years
📧 Free 8-email course + subscriber-only pack of 13 MT5 indicators
* Privacy strictly protected. You can unsubscribe at any time.
Have a question about EAs or FX?
You can post it on the Nattzy trading forum (free sign-up). Questions beyond this article are welcome too — EA settings, choosing a broker and more.
Ask on Nattzy ↗