
Midnight spreads run up to 10x daytime, so the EA now waits
Optimizing entry times for D1 (daily timeframe) sleeves has led to the implementation of a rollover guard in EA v1.17.0, which delays new entries by…
Optimizing entry times for D1 (daily timeframe) sleeves has led to the implementation of a rollover guard in EA v1.17.0, which delays new entries by five minutes after the midnight server clock. My testing confirms that this simple adjustment resolves a systematic cost that never appeared in standard backtests.
The Problem with Midnight Entries
Many of my strategies (specifically those triggering on the daily, H4, or H1 bars) were programmed to enter the market exactly at 00:00. This timing hits the “rollover” period, where liquidity dries up and spreads widen significantly. Because standard backtests assume normal trading conditions, this real-world cost was invisible and effectively acted as a hidden drain on performance. My previous research indicated that this rollover impact could account for a monthly loss of 0.076 points.
Real-World Spread and Drift Analysis
I analyzed 13 currency pairs over 30 trading days using tick data to see how severe the spread widening actually is.
| Metric | Findings |
|---|---|
| Spread (0-5 min) | 2.5 to 10 times wider than normal daytime spreads. |
| Spread (15-60 min) | Normalizes to 1.0 to 3.3 times the daytime spread. |
| Price Drift (+5 min) | The price often moves in the direction of the trade by 0 to 1.1 pips. |
| In other words, the “danger zone” for spreads is concentrated in the first few minutes of the day. While waiting five minutes means I occasionally miss a slightly better entry price (the drift), the savings from avoiding the massive rollover spreads far outweigh the cost of the delay. For example, in EURNZD and GBPNZD, the spread savings exceed 10 pips per trade. |
Implementation: EA v1.17.0
I have introduced a new parameter called InpRolloverDeferMin, which is set to 5 minutes by default. When the EA generates a new entry signal at midnight, the request is moved to a holding queue and executed only when the five-minute window has passed.
This guard also provides an automatic safety net for Monday morning market openings, where spikes can reach 10 to 56 pips. Crucially, I have not applied this delay to exit signals. If a trade needs to be closed to manage risk, waiting is not an option; my existing retry mechanisms for trade exits already handle those scenarios.
Verdict
I am adopting and deploying this update. It provides an estimated recovery of 0.02 to 0.05% per month. While the relative pips saved are small compared to the wide stop-loss distances typical of D1 strategies, this is essentially “free” performance. It improves execution quality without requiring me to change my risk parameters or underlying assumptions. Moving forward, I will continue to calibrate these findings against actual broker telemetry to ensure the delay remains optimal for different liquidity providers.
How this connects
This verification builds on earlier ones (what failed before and what I tried this time, comparisons between approaches).