Page 1 of 1

Server time, local time, UTC: getting EA time filters right

Posted: Mon Nov 02, 2026 11:14 am
by FXS London Scalper
Time filters in EAs are a common source of bugs. "Trade only between 08:00 and 11:00 London" sounds simple until clocks change.

The three clocks:
  • Server time: the broker's time, often GMT+2 or GMT+3 to align daily candles with New York close.
  • Local time: the VPS or PC clock.
  • UTC: the reference everything can be converted to.
Problems:
  • Brokers change server time for daylight saving, usually on the US schedule.
  • London changes on a different date from New York, so during the daylight-saving mismatch weeks the offset between them changes.
  • Hard-coded server hours break twice a year.
A safer approach: work in UTC internally (TimeGMT in MQL5), and convert to London time with an explicit daylight-saving rule. Check the conversion against a known event, for example a 07:00 London data release, on both sides of each clock change.

A test: run the EA's time filter function for dates in March, April, October and November, and print the London time it calculates.

How do you handle time zones in your EAs?