Advertisement IC Markets

Spread in historical data: the number that is usually wrong

Share, develop, and backtest custom MQL4/MQL5 Expert Advisors, Python data-scraping scripts, trading bots, and automated market alert systems.
Post Reply
Fairman
Posts: 6757
Joined: Tue Jul 21, 2026 7:11 am
Location: Abuja

Spread in historical data: the number that is usually wrong

Post by Fairman »

Spread in historical data: the number that is usually wrong

A backtest needs a spread. Many testing environments use a fixed value, or the spread recorded at the bar's open. Neither matches reality.

Spreads vary within a bar. They widen during news, narrow during busy periods, and jump at rollover. A strategy that enters at a moment of tick activity often does so at a wider than average spread.

Assuming a fixed 0.8 pips when the actual spread at entry averaged 1.2 overstates performance by 0.4 pips per trade. For a strategy with a 2-pip average gain, that is a 20 percent error.

Better testing uses a variable spread from real recorded data. Even a rough profile by hour of the day improves on a fixed number.

Another trick is to add a random penalty to simulate adverse spread conditions, then see whether the strategy survives. A system that falls apart with an extra half pip of cost was never robust.

How sensitive is the strategy to an increase of half a pip in cost per trade?
It’s Fairman :geek:
Recommended broker for automated trading & scalping IC Markets
Post Reply