How to Model Spread Costs in a Backtest

Last updated: 2026-06-10

In short

You pay the spread on every round trip: longs enter at ask and exit at bid. Three ways to model it, best first: (1) replay real bid/ask data so fills include the spread automatically, (2) subtract a session-aware spread estimate per trade, (3) subtract a flat average — acceptable only for strategies with large targets. A 0.8-pip spread against a 10-pip target costs 8% of every winner.

How the Spread Actually Charges You

Every quote has two prices: the bid (where you can sell) and the ask (where you can buy). The chart you look at usually plots only one of them — most platforms draw bid-price candles. The gap between the two is the spread, and it charges you mechanically:

  • Long trade: enter at ask (above the chart price), exit at bid. You start every long spread-distance underwater.
  • Short trade: enter at bid, exit at ask. Same cost, other side.
  • Stops and targets: a long’s stop-loss triggers on bid; a short’s stop triggers on ask. This is why “price never touched my stop on the chart” stops still fire — the chart showed bid, your short’s stop watched ask.

That last mechanic matters for backtesting: if your test uses chart (bid) prices for both sides of every trade, it executes at prices you cannot get, and it misjudges stop touches on shorts by the spread distance.

What Spreads Typically Look Like

Representative averages on retail CFD accounts (spread-only pricing; raw accounts are tighter but add commission):

InstrumentTypical averageThin-session / news behavior
EUR/USD0.6–1.2 pips2–5+ pips at rollover and red news
GBP/USD0.9–1.5 pipssimilar spikes
GBP/JPY1.5–3 pipswide and jumpy in Asia
Gold (XAU/USD)$0.15–0.40$1+ at news
US indices (CFD)0.4–2 pointsmultiples outside cash hours
BTC/USD$10–50very wide on volatility

Two structural facts to respect: spreads are not constant (they breathe with liquidity, blowing out around the 22:00 GMT rollover and scheduled news), and they differ by broker (each runs its own pricing — see why broker feeds differ).

Three Ways to Model It

1. Replay real bid/ask data (best). If your replay tool streams recorded bid/ask quotes, simulated fills happen exactly as live fills would: longs at ask, stops on bid, spread widening included because it’s in the data. Tick-level tools work this way — StrategyTune replays recorded bid/ask quotes, so a backtest there is net-of-spread by construction. Nothing to add afterward; the spread column in your journal is $0 because it’s already in every fill.

2. Session-aware subtraction (good). Testing on bid-only candles? Subtract your broker’s typical spread for the session you trade from every round trip. A London-session EUR/USD scalper subtracts ~0.7 pips per trade; the same strategy tested in the Asian session should be charged 2–3× that. Keep it as an explicit journal column so the cost stays visible.

3. Flat average subtraction (acceptable for big targets). Swing strategies targeting 50+ pips can subtract a single flat average without much distortion — at that scale, being wrong by half a pip per trade barely moves the result. For anything with targets under ~15 pips, session-awareness is mandatory: a flat “0.8 pips” applied to trades taken at rollover understates the real cost by several multiples.

Worked Example

Intraday EUR/USD strategy, 100 trades, 55% win rate, +10/−8 pip targets/stops. Gross expectancy:

(0.55 × 10) − (0.45 × 8) = +1.9 pips/trade → +190 pips total

Apply spread three ways:

Modeling choicePer-trade costNet resultError vs reality
Ignored (typical backtest)0+190 pips+44% overstated
Flat 0.8 pips−0.8+110 pipssmall if sessions match
Session-aware (mixed London/rollover trading)−1.3 avg+60 pipsclosest to live

The strategy is still profitable — but its real edge is a third of the chart’s version, and position-sizing decisions made on +190 would be badly wrong. As a rule of thumb, express spread as a percentage of your average winner: under 5% and it’s a rounding error; over 15% and the spread, not the market, is your main opponent.

Checklist

  • Know whether your test data is bid-only or bid/ask — and whether your fills respect ask-side entries.
  • Use your broker’s spread for your trading session, not the marketing-page minimum.
  • Charge every round trip, including losers and breakevens.
  • If targets are tight, re-run the result with the spread doubled — if the edge dies, it was never robust.

Related: commission models · the full worked cost audit · tick vs OHLC data

Frequently Asked Questions

Does the spread apply twice per trade?

It applies once per round trip — you cross the full bid/ask gap between entry and exit. Thinking of it as half on entry and half on exit reaches the same total; just don't charge the full spread on both legs, which double-counts it.

Why did my short get stopped out when the chart never touched my stop?

Charts usually plot bid prices, but a short position's stop-loss triggers on the ask price, which sits one spread above the bid. During a spread spike — rollover, news — the ask can touch your stop while the bid candle on the chart never reaches it.

Do tick-replay backtests need a spread adjustment afterward?

Not if the tool replays real bid/ask quotes and fills your orders against them — the spread cost is then embedded in every simulated fill, including widening during volatile moments. Candle-based replays do need the adjustment, because a single price series contains no spread information.

Is a wider spread ever acceptable?

Yes — spread-only accounts have wider spreads but no commission, which can be cheaper for low-frequency strategies. What matters for the backtest is charging whichever total cost structure (spread, or raw spread plus commission) matches the account you'll actually trade.

More in Costs

All Costs →

Practice This in a Free Replay Tool

StrategyTune replays real bid/ask tick data for 70+ instruments in the browser — free, no registration, no downloads. Place simulated trades and see your stats build.

Open StrategyTune