Trading Sessions and Server Time: Getting Time Right in Trading Bots
Asian, London and New York sessions, overlaps and rollover; broker server time vs UTC vs local time; daylight-saving shifts; and how to define session windows in a trading bot without bugs.
Session strategies, daily pivots, news filters and rollover rules all depend on one thing: knowing what time it is in the right time zone. Time bugs are among the most common reasons a strategy behaves differently live than in a backtest - and they often appear only twice a year, when clocks change.
The main sessions
FX and many CFDs trade almost 24 hours on weekdays, with activity concentrated in sessions (times approximate, local to each centre):
| Session | Typical character |
|---|---|
| Sydney / Tokyo (Asian) | Quieter for European pairs; active for JPY, AUD, NZD |
| London | Highest FX volume; frequent breakouts from the Asian range |
| New York | US data releases; London/New York overlap is the most liquid period |
| Rollover (around 17:00 New York) | Spreads widen, liquidity thins, swaps applied |
Strategies such as the London breakout and opening range breakout are built entirely around these windows.
Three clocks
- Broker server time - the time stamp on your charts and bars. Many FX brokers use UTC+2 in winter and UTC+3 in summer so that daily candles close at 17:00 New York time.
- UTC - the neutral reference without daylight saving.
- Your local time - irrelevant to the market, but often used by mistake.
A daily candle, a daily pivot and a “previous day high” all depend on the server’s definition of a day. See pivot points.
Daylight saving: the twice-a-year bug
Europe and the United States change clocks on different dates. For a few weeks in spring and autumn:
- the London-New York gap is 4 hours instead of 5;
- a session window defined as “07:00-10:00 server time” may start an hour early or late relative to London;
- a backtest over many years mixes correct and shifted periods.
Defining sessions in a bot
- Choose a reference zone for the strategy logic - often the session’s own city time (London time for a London breakout).
- Convert to the bot’s clock for each date, using proper time-zone rules (not a fixed offset).
- Store session definitions as parameters (start, end, time zone) rather than hard-coded server hours.
- Log the computed windows for each day in testing, and check dates around clock changes.
In cTrader, a cBot can declare the time zone it works in, and the server time is available to the code; converting session times explicitly avoids surprises when the broker’s server zone differs from your assumptions.
Rollover and weekends
- Avoid new entries in the window around rollover; spreads widen and fills worsen.
- Swaps are applied at rollover; one weekday usually carries a triple swap for the weekend.
- Weekend gaps - decide whether positions may be held over the weekend; many intraday bots close on Friday.
- Sunday open - the first bars after the weekend are often thin and gappy.
A checklist for time-dependent strategies
- Strategy times defined in a named time zone, converted per date.
- Daily boundaries match the broker’s server day.
- Behaviour verified around both daylight-saving changes.
- Rollover window excluded from new entries.
- Friday close and Sunday open behaviour tested.
- Backtest data uses the same server time zone as live trading.
Key takeaways
- Sessions shape volatility, spreads and the behaviour of breakout strategies.
- Broker server time, UTC and local time are different clocks; use one reference.
- Daylight-saving changes shift sessions twice a year - define windows by time zone, not fixed offsets.
- Avoid rollover and handle weekends explicitly.
FAQ
Why does my session strategy behave differently in March and November?
Because Europe and the United States switch to and from summer time on different dates. For a few weeks the gap between London and New York changes by an hour, and session windows defined in a fixed time zone shift.
Should a bot use UTC or server time?
Pick one reference and convert everything to it. Many developers run bots in UTC and convert session times explicitly; others use the broker's server time. Mixing them is the source of most time bugs.
When is rollover?
For most FX brokers, around 17:00 New York time, when the trading day ends and swaps are applied. Spreads typically widen for a short period around it.
Sources and further reading
- cTrader Help: cBot lifecycle - help.ctrader.com
- StockCharts ChartSchool: Pivot Points - chartschool.stockcharts.com