TESTING · 8 MIN READ

How to backtest a strategy without fooling yourself

A backtest you can trust holds data back for one final test, uses few parameters, and runs the same code that trades live. Every backtest is a simulation, and the assumptions built into it decide the result at least as much as the strategy does.

Five backtest assumptions that inflate results

  • Fixed spread. Live spreads widen at rollover, at session changes and around news, which is exactly when signals cluster. A test with a constant narrow spread is testing a market that does not exist.
  • No slippage. A replay fills at the modelled price and a live account does not. Every entry and exit is a little worse live, and the difference adds up over hundreds of trades.
  • Favourable intrabar order. When a bar touched both the stop and the target, the tester has to assume which came first. Optimistic assumptions inflate results a lot, and most of all on tight stops.
  • Lookahead. Using information that was not available at the time. A swing point is not confirmed until several bars after it forms, so a test that treats it as known when it forms is measuring a strategy nobody can trade.
  • Position sizes you could never place. Fractional lots, no broker minimum, no margin limit. Real accounts have all three.

The price data is a trap of its own. An "overnight long gold" idea was green on 52 of 82 months on a free historical feed. On Exness's own bars it was green on 48 to 51 of 82 with no swap, and on 40 of 82 with the swap a normal account paid at the time. The free feed's entry prices were about $0.72 an ounce too cheap. Test on the prices your broker actually quotes.

What makes a backtest trustworthy

Hold data back and test on it once. Fit and tune on one period, then run a single test on a period you never used during development. Each extra look at the held-out data leaks information, until the out-of-sample period has quietly become part of the training set.

Use fewer parameters. Every extra setting is another dimension along which noise can be fitted, and the more combinations you tried, the higher the bar for believing the result.

Test with the code that trades. Rewriting a strategy for backtesting creates differences you cannot see until live results disagree. Our replay runs real broker bars through the live signal path, with the real tracker choosing the strategy, so no second version of the code exists.

The numbers a backtest should publish

Maximum drawdown, the length of the test, whether an out-of-sample period was used, and the number of trades. A win rate without the average win and average loss beside it is the flattering half of the picture, and a precise figure from a small sample is noise. See sample size.

Our own: On live client accounts, the bot's accuracy has been 60–80%. In backtesting, the Conservative + gold rules profile at a fixed 0.02 lot was replayed on 22 months (Jan 2025 – Oct 2026), each month on its own from $1,000 with a fresh bot. The average month made +$274.60; 17 of 22 months were profitable and the worst drop inside a month was $860, 86% of the account, across 1,297 trades at a 47% win rate. Two months, October 2025 and January 2026, made 56% of the total, so even 1,297 trades is not a sample to treat as precise. Earlier years were much weaker: on 2019–2024 price history the same profile made about +$5 a month, close to break-even.

How the same strategy produced two different results

Our earlier windowed runs and our continuous run were the same rules on the same instrument over overlapping dates. They differ by roughly seven times on total return. The only change between them was how the position size was calculated. It is the most expensive backtesting mistake we have made, and it is on no list of the usual five.

Windowed runsContinuous run
Position sizeFixed 0.01 lot every tradePercentage of live equity
Learning stateReset to blank each monthCarried forward throughout
Balance effectNone: size never changesWins and losses compound into the next size
AnswersDo these rules have an edge?What happens to an installed bot?

At a fixed lot every trade carries the same weight, so the result is a clean measure of whether the rules win more than they lose. Under percentage risk the weights differ, and one losing trade that happened to be sized larger can outweigh several smaller winners. One month in our own data flips sign on exactly that: +$10.18 at a flat 0.01 lot, and −$0.17 at $1,000 with real percentage sizing. The trades and their order are identical, and the conclusion is the opposite.

Neither measurement is wrong. The error is dividing dollar totals earned at a fixed lot by an account balance that was never sized that way, then publishing the percentage as what to expect. We did that once, and it is how a genuine +3.5% became an advertised +25.3%. See what our figures actually say.

What our replay does differently

Our replay closes three of the ways a backtest lies:

  • It runs the live signal engine. Real broker bars are replayed through the same code path that trades, with the real tracker choosing the strategy, so there is no second version to drift away from the first.
  • It cannot write anything. The replay is isolated from live state and restored from a snapshot, so a run cannot leave learned state behind. Before we enforced that, a second identical run in the same process returned a different result, because the first had already updated the tracker the second was about to read.
  • It applies the full live gate chain. Session hours, the spread guard, regime detection, the concurrency cap and the daily lockdown all run exactly as they do live. A backtest that skips the gates measures a strategy the bot would never have been allowed to trade.

The learning mode matters as well. A walk-forward run starts from a blank slate with every operator override cleared, which reproduces a fresh install instead of this machine's accumulated tuning. That is the difference between testing the product and testing your own copy of it.

Keep reading

Further reading

Our published research →The 34 strategies we tested

Educational information only, not financial advice. Trading leveraged products carries substantial risk of loss. Last updated 2026-11-11.