The True Cost of a Trade: Modeling Costs in Backtests

Spread, swap, commission, leverage, slippage — how each one eats backtest profits, with worked numbers nobody else publishes.

In short

Backtests fail live mostly because they count gross profits, not net. Four costs stand between the two: spread (paid on every trade), swap/financing (every overnight hold, 3× on Wednesdays in forex), commission (on raw-spread accounts), and slippage (worst at news). A 10-pip scalping target with a 0.8-pip spread gives up 8% of every winner before anything else. This guide shows how to count each one.

Why Costs Are the Silent Backtest Killer

Every cost is small. None of them shows up on a chart. And they apply to every single trade, which is exactly why they compound into the gap between a winning backtest and a losing account. Major broker education content admits the problem — Admiral Markets' backtesting guide advises including "slippage, spreads, and order delays" — but stops short of showing how. Here's the how.

Most strategies don't fail in backtesting — they fail in the gap between gross and net. The higher your trade frequency and the smaller your average winner, the wider that gap. A position trader making 80 pips per winner barely notices a 1-pip spread; a scalper making 6 pips loses a sixth of every win to it.

Spread: the Cost You Pay Every Time

The spread is the gap between bid (where you sell) and ask (where you buy). You cross it on entry or exit of every round trip — long entries fill at ask, stops on longs fill at bid. Typical averages: EUR/USD 0.1–1.0 pips depending on account type and session; GBP/JPY 1–3 pips; gold $0.10–0.50; index CFDs 0.3–2 points. Spreads widen sharply at rollover (22:00 server), during news, and in thin Asian-session hours — sometimes to several times their average.

How to model it:

  • Best: replay real bid/ask data. If your replay tool streams recorded bid/ask quotes — as tick-level tools like StrategyTune do — simulated fills already include the spread at the moment of the trade, including its widening. Nothing to add afterward.
  • Otherwise: subtract a per-trade spread estimate. Use your broker's average for the instrument and the session you trade, and subtract it from every round trip in your journal. Using the London-session average for trades taken at rollover will still flatter your results.

Swap / Overnight Financing: the Multi-Day Tax

Hold a leveraged CFD or forex position past your broker's rollover time and you're charged (or occasionally credited) financing — "swap." It reflects the interest-rate differential of the pair plus the broker's markup; long and short rates differ, and both can be negative. In forex, Wednesday rollover books three days of swap to cover the weekend (FX Empire's backtest-settings guide covers the mechanics well).

Worked example: short EUR/USD 1 standard lot, swap −$7.10/night (illustrative — check your broker's current rates). A 10-night hold costs ~$71, i.e. ~7 pips — on a swing trade targeting 60 pips, that's 12% of the target gone to financing. No replay tool we know of models swap; track it as a journal column per the FAQ below.

Commission: Know Your Account Type

  • Spread-only accounts: no commission; the cost is a wider spread.
  • Raw/ECN accounts: near-zero spread plus a fixed commission, commonly ~$3–3.5 per standard lot per side (~$6–7 round trip ≈ 0.6–0.7 pips on EUR/USD).

Model whichever account you'll actually trade: either the wider spread or raw spread + commission per round trip. Counting neither — the default in most manual backtests — overstates every result; counting both overstates costs.

Leverage & Margin: Sizing, Not Free Money

Leverage doesn't change a strategy's per-unit results; it changes how large a position your margin supports — and how fast losses compound. For backtesting, fix risk per trade (e.g. 1% of account), derive position size from stop distance, and check that the size stays within your margin at realistic leverage (EU retail caps: 30:1 major FX, 20:1 minors/gold/indices, 2:1 crypto). A backtest that "risks 1%" but would have required 80:1 leverage on a retail account tested something you can't actually trade.

Slippage: Model the Modelable, Respect the Rest

Slippage is the difference between intended and actual fill price. Two honest statements: market orders in calm, liquid majors typically slip little; and no backtest of any kind can reliably model news-event slippage, where price gaps through stops. Practical handling: add a flat 0–0.5 pip penalty per trade for liquid majors if you want a buffer, avoid holding tight-stop positions through scheduled red-news, and treat stop fills at the stop price as optimistic during volatile periods. Tick-level replay at least shows you the true price path so stop-touch decisions aren't guesses; what it can't show is how far your particular broker would have slipped you in that moment.

Worked Example: the Same Backtest, Gross vs Net

100-trade EUR/USD intraday backtest; 55% win rate; winners +10 pips, losers −8 pips; 20% of positions held one night; raw-spread account.

Line Pips
Gross: (55 × 10) − (45 × 8)+190
Spread, 0.2 pips × 100 trades (raw account)−20
Commission, ~0.65 pips × 100−65
Swap, ~0.7 pips × 20 overnight holds−14
Slippage buffer, 0.2 pips × 100−20
Net+71

63% of the gross edge went to costs. The strategy survives — many don't. Run this arithmetic on any backtest before trusting it: if your edge doesn't clearly survive the cost stack, it doesn't exist.

Putting It into Practice

Costs are easiest to respect when the data shows them. Replaying on real bid/ask ticks (e.g. EUR/USD on StrategyTune, free in the browser) bakes spread into every fill automatically; add swap and commission as journal columns using your broker's published rates, and you have a net-of-costs backtest — the only kind worth reading. Next: the data quality guide, because costs are only half of what charts hide.

Frequently Asked Questions

Do replay backtesting tools model the spread?

Only tools that replay real bid/ask quotes do. Tick-based replay tools like StrategyTune fill simulated orders against recorded bid and ask prices, so spread cost is built into every fill. Candle-stepping tools replay a single price series, so the spread — and its widening during news and rollover — is invisible and must be added to results manually.

How do I add swap costs to a manual backtest?

Add a journal column: for every position held past your broker's rollover time (typically 22:00 GMT+2 server time), subtract one day of swap for that instrument and direction, and three days for forex positions held over Wednesday rollover. Current swap rates per instrument are published by your broker; long and short rates differ and either can be positive or negative.

Why are my live results worse than my backtest?

The most common reason is uncounted costs: spread on every trade, swap on every overnight hold, commission per lot, plus occasional slippage. A strategy netting 2 pips per trade gross is unprofitable on most accounts after a 1-pip average spread. Audit the backtest with a cost model before blaming execution.

Are CFD trading costs higher than futures or stocks?

Per-trade spread on major forex CFDs is competitive, but CFDs add overnight financing charges that grow with holding time, while futures embed financing in the contract price. For multi-week holds, financing usually makes CFDs the more expensive vehicle — a cost a backtest must include to be honest.

Deep Dives in This Series

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