“Trade from 09:30 to 11:00” is incomplete until the clock and calendar are named. A session rule should identify the exchange-local time zone, daylight-saving behavior, holidays, early closes and the source of timestamps used by the strategy.
Published 17 November 2026. All times and signal outcomes in the example are hypothetical; they are not exchange observations or an Edge Quant backtest.
There may be three different clocks
A data feed can timestamp events in UTC, an exchange defines sessions in its local time zone, and a trading platform can expose broker-server or computer-local time. These clocks can differ by hours and can shift relative to each other when daylight-saving rules change. A strategy that stores only a fixed UTC offset may drift by an hour when one region changes clocks before another.
MQL5 documents distinct functions for server, local and GMT time. In particular, TimeCurrent() is the last known server time from a quote, while TimeTradeServer() estimates the current server time using the terminal’s computer settings; in the Strategy Tester it is simulated and equals TimeCurrent(). Code and tests should use the intended clock consistently instead of assuming a function name means exchange-local time.
A session is a calendar rule, not just a pair of numbers
Exchange schedules include regular sessions, maintenance breaks, holidays and early closes. CME publishes product and holiday schedules and notes that holiday hours can be subject to change. A generic “weekday session” filter does not encode these exceptions, and a symbol’s broker session may differ from an exchange’s schedule.
Define the market whose clock governs the strategy. For an exchange-traded contract, record the relevant venue and product calendar. For an OTC instrument, use the broker’s published trading sessions and clarify the server time zone. Store timestamps in a canonical representation such as UTC, then convert with a named time-zone database rule when evaluating local sessions.
A hypothetical daylight-saving boundary
Hypothetical example: a strategy intends to trade the first 30 minutes of a U.S. cash-equity session. Its rule is coded as 14:30–15:00 UTC based on a winter offset. During weeks when U.S. and European daylight-saving transitions are not aligned, that fixed UTC window can start an hour away from the intended U.S. open. The correct rule is to map the exchange-local session to UTC using the applicable calendar date, not to hard-code one offset year-round.
The example only illustrates clock conversion. It does not claim a particular market outcome or establish that a session strategy has an edge.
Check how bar boundaries and data timestamps work
Intraday data can label bars by their opening time or closing time. A bar stamped 09:30 might represent the interval beginning at 09:30, while another vendor may label the completed interval differently. If a signal is evaluated at a bar close and an order is sent at the next tick, a session filter can produce a different decision near the boundary than a filter evaluated on the opening timestamp.
Specify whether the start is inclusive, whether the end is exclusive, how missing bars are handled, and whether the strategy may open a position just before a break or early close. Test timestamps around midnight, weekends, holiday sessions and each daylight-saving transition. Compare the research convention with the live platform clock and log both values during a forward test.
A compact implementation checklist
- Name the governing exchange or broker time zone, not a fixed UTC offset.
- Record whether timestamps mark bar opens, closes, quotes or executions.
- Use the applicable session and holiday calendar, including early closes and breaks.
- Define inclusive and exclusive session boundaries and behavior for missing data.
- Test the weeks when regional daylight-saving changes are out of sync.
- Log normalized UTC and local session time in research and live diagnostics.
- Keep calendar assumptions fixed across in-sample and out-of-sample periods.
The practical takeaway
A robust intraday rule follows the market’s named time zone and calendar rather than the machine’s clock. Document timestamp semantics, daylight-saving conversion and holiday behavior, then test boundary cases explicitly. This makes the schedule reproducible; it does not by itself make a trading signal profitable.
Primary references
- MQL5 Reference: Date and Time functions ↗
- MQL5 Reference: TimeTradeServer ↗
- CME Group: Holiday and Trading Hours ↗
References reviewed 17 November 2026. Original exercises and project-specific observations are identified separately.
Keep exploring
Audit timestamps and market data ↗Educational engineering and research guidance. Examples do not establish a profitable or live-ready trading strategy.