When you set an intraday EA's lookback to 100 bars, you are not choosing a number — you are placing a wager that the regime distribution of those bars will still describe the market on the day you deploy. For most strategies optimized before April 2025, that wager has already lost. The Liberation Day tariff shock and the subsequent dollar collapse — DXY falling roughly 11% in the first half of 2025, its steepest first-half decline since 1973 — did not just move prices. It silently rewrote the regime composition that every fixed-window backtest had quietly assumed was permanent.

The Lookback Window Is a Bet, Not a Setting

Most MT5 traders treat the lookback window as a tuning knob — something to grid-search alongside stop distance and the RSI period. That framing hides what the parameter actually does. A lookback window of N bars defines the empirical sample your optimizer learns from, which means it implicitly fixes the mix of market conditions the strategy is fitted to. Choose a window that happens to sit inside a low-volatility range, and the optimizer concludes the world is mean-reverting. Choose one that straddles a directional breakout, and the same code learns to chase trends.

The 2021–2025 stretch makes the point concrete. It contains at least four distinguishable regime phases: the post-COVID bull of 2021, the aggressive Fed tightening and >30% equity decline of 2022, the tech-led recovery of 2023–2024, and the tariff-shock macro uncertainty of 2025. A backtest drawn only from 2023–2024 data — a perfectly reasonable-looking two-year sample — captures exactly one of those four regimes. The window looks representative. Its effective regime content is not.

Short Windows Are Noisy, Long Windows Are Stale

The window-length decision is a bias-variance tradeoff dressed up as a platform setting. Too short, and the sample is dominated by noise — a handful of sessions can swing the optimized parameters wildly. Too long, and you import stale regime data that no longer reflects current dynamics, biasing the fit toward conditions that have already passed.

Empirical work puts numbers on the sweet spot. An evaluation of sliding-window lengths for short-term systematic strategies — testing 5, 10, 15, 20, and 30-day windows — found that a 15-day window consistently produced the most robust results across multiple metrics: shorter windows were too noisy to generalize, while longer ones introduced stale-regime bias. That is not a universal constant to hard-code, but it is a useful prior: the temptation to lengthen the window for "more data" actively works against you once a structural break sits inside the sample.

The deeper problem is that the optimal length is not static. As the adaptive-window research bluntly states:

The optimal lookback length changes dynamically across different market periods; continually updating the lookback length is important due to the dynamic nature of markets.

A fixed window is, by construction, wrong most of the time — the only question is by how much.

Why Intraday Strategies Pay the Heaviest Penalty

Lookback-window fragility is a general problem, but intraday EAs suffer disproportionately for two structural reasons. The first is statistical. Robust validation needs trades — a commonly cited floor is 100–200 trades minimum for statistical significance, and 200–500 trades to span bull, bear, and sideways conditions. An intraday strategy generates trades quickly, but it also burns through regimes quickly, so clearing the significance bar and covering multiple regimes inside one window pulls the requirements in opposite directions. You need a window long enough for hundreds of regime-spanning trades, yet short enough to avoid pooling pre- and post-break data.

The second reason is intra-session structure. Intraday flow is not regime-homogeneous within the day. VWAP mean reversion, for instance, is most statistically reliable in the first 90 minutes and final 60 minutes of the session, when institutional order flow is heaviest — a time-of-day dimension that a naive bar-count lookback ignores entirely. A regime-conditioned mean-reversion framework for intraday FX (Bhatti, SSRN 2026, implemented in MQL5/MT5) demonstrated the cost of ignoring this:

Mean-reverting behavior deteriorates significantly during trending regimes; conditioning on higher-timeframe momentum states improves signal quality.

For intraday systems, the lookback window has to encode not just how much history but which history — and the per-trade resolution that makes intraday attractive is exactly what makes its windows so sensitive to regime mix.

The 2025 Tariff Shock Broke Every Pre-April Window

The April 2025 tariff announcement is the cleanest regime-transition case study in recent memory. The VIX spiked roughly 40% in its wake, with EAFE volatility up around 24%, and the dollar entered a sustained decline — DXY traveling from about 109 in January 2025 to a low near 96 by September, before stabilizing near 99 into 2026. The market shifted from a low-volatility, rate-driven range environment to a high-volatility, policy-shock trending one. Any mean-reversion EA whose window was calibrated on the placid 2023–2024 recovery was suddenly deployed into a world its training sample had never seen.

This is the structural mirror of 2022, when trend-following EAs optimized on the low-volatility 2020–2021 range were destroyed once 75bp hikes triggered multi-month directional moves. The 2025 shock simply ran the same inversion in the opposite direction — punishing mean-reverters this time instead of trend-followers. The lesson is symmetric: a window calibrated inside one volatility regime is a liability the moment the regime flips.

Visualizing the break is the fastest way to internalize it. Traders can monitor these levels in real time using TradingView, which lets you overlay the DXY 109→96→99 trajectory against annotated regime phases and see directly how a fixed 100-bar window captures a completely different condition mix depending on where on that curve it falls. The chart is not a signal source here — it is a sanity check on what your backtest sample actually contained.

Long Lookbacks Also Leak Information at the Boundary

Even setting regime mix aside, long indicator lookbacks introduce a subtler defect: information leakage across the train/test boundary. A March 2026 study formalizing in-sample / walk-forward / out-of-sample evaluation (AlgoXpert, arXiv:2603.09219) documented the mechanism directly:

Long indicator lookbacks cause overlap at train/test boundaries... strategies with position management make current decisions dependent on the prior path.

The practical effect is that a strategy's first out-of-sample bars are computed partly from in-sample data still inside the indicator's window, inflating apparent OOS performance. The adaptive-window literature describes the same pathology at the regime level:

After a structural break, full-window benchmarks continue to pool pre-break observations; fixed rolling windows still mix pre- and post-break data for roughly one window length.

That "roughly one window length" is the quiet killer. After a shock like April 2025, a fixed 100-bar intraday window keeps feeding the optimizer dead-regime data for the next 100 bars before it fully adapts — precisely the window in which a live EA is most exposed and least understood.

Key Risk for EA Developers: A long lookback combined with path-dependent position management means your out-of-sample split is not as clean as the platform reports. The longer the indicator window, the more in-sample contamination bleeds across the boundary — and the more your OOS metric flatters a strategy that has not actually been tested on unseen data. Shorten the window or insert a purge gap equal to the longest lookback before the OOS segment begins.

A Re-Calibration Framework You Can Run This Week

The fix is not graduate-level math — it is discipline applied to three checks the strategy tester already supports.

  1. Verify regime coverage before trusting any metric. Confirm the backtest sample actually contains trending, ranging, and high-volatility sessions — not just the count of trades but their distribution across conditions. Aim for the 200–500 regime-spanning trades that robust validation requires, and explicitly flag any window that sits entirely inside one regime phase.
  2. Hold the IS/OOS line. The canonical MT5 split is 70% in-sample, 30% out-of-sample, with OOS performance expected to clear at least 80% of in-sample performance before deployment. A strategy that decays sharply across that boundary is telling you the in-sample window was regime-specific.
  3. Re-optimize on a cadence, and faster after a shock. Common practice is a rolling re-optimization roughly every six months, but the "one window length" contamination rule means a discrete regime event — a tariff shock, a central-bank pivot — should trigger an off-cycle re-calibration rather than waiting for the calendar.

The broader move is to stop treating the lookback as a fixed constant and start treating it as a state variable that tracks the regime. Adaptive window-selection methods reduced cumulative forecast loss versus fixed rolling windows specifically during structural-break episodes — the periods when fixed windows fail worst. You do not need to implement a full adaptive estimator to benefit from the insight; you need to recognize that a window chosen in one regime carries an expiry date, and to build the re-calibration trigger into your process rather than discovering the expiry the hard way in live trading.

None of this guarantees a durable edge. Regime transitions will keep invalidating windows, and no cadence catches every break in time. But the framing dissolves the illusion that a backtest period that "looks representative" actually is. The lookback window encodes a bet on regime persistence — and after April 2025, the only safe assumption is that the bet needs re-placing more often than most MT5 traders are placing it.

Ready to build and test your own strategies?

FX Strategy Analyzer's EA Analyzer Pro helps you stress-test MT4/MT5 strategies across historical regimes — built by traders, for traders.

Open EA Analyzer Pro →
Charting Tool

Track live market conditions alongside your EA performance. TradingView gives you professional-grade charts and real-time data — new subscribers receive $15 toward their first plan.

Open TradingView Charts →
Related Articles
EA & Strategy Analysis
Walk-Forward Optimization Best Practices for MT5
The IS/OOS rolling framework that determines how and when your lookback windows get re-set.
EA & Strategy Analysis
Why Do So Many Backtests Fail in Live Trading?
Structural backtest failure modes — lookback-window regime bias is one of the root causes.
Market Regimes
How to Detect Market Regimes Before It's Too Late
The regime-detection tools that should inform every adaptive lookback decision.
EA & Strategy Analysis
Decay or Drawdown? A Statistical Test for When to Kill Your EA
The regime transition that invalidates a window is the same event that triggers strategy decay.
Lookback Window Backtesting Market Regime Intraday EA Walk-Forward Optimization Overfitting MQL5 DXY