Handling Forex Time Zones, Daylight Saving, and Local Trading Sessions
Summary
This document describes a software library for obtaining local times across major Forex market locations, converting between local, UTC, and broker server times, and checking whether configured trading sessions are open. It explains UTC offset conventions and daylight saving changes, and outlines interfaces for time zone information and session hours. The library includes preset locations as well as custom time zone support; session times can be set for each location.
Broker time is estimated from hourly price history, with gold quotes used by default and an option to use the chart symbol instead. The document notes that this estimation choice can affect daylight saving switch timing in the strategy tester, and that simulated GMT time may differ from true GMT. These details matter when an expert advisor or indicator trades by session boundaries, but the document is primarily API documentation rather than a trading method. It does not provide comparative accuracy measurements, and broker schedules and historical quote availability can limit the estimate.
Key ideas
- The library converts times among local market zones, UTC, and broker server time while accounting for daylight saving changes.
- Session objects allow users to configure local opening and closing times and check whether a session is active.
- The library uses its own positive-east offset convention, which is opposite to the sign convention described for a built-in MQL5 function.
- Broker time zone and daylight saving estimates rely on hourly quote history, with gold as the default reference symbol.
- In the strategy tester, simulated time and the chosen estimation symbol can affect the timing of daylight saving switches.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.