How to Backtest a Trading Strategy
Backtesting is applying a strategy's exact rules to historical data to estimate how it would have performed. Done honestly, it answers cheaply what live trading answers expensively: does this rule set have positive expectancy, and what does its pain look like? Done dishonestly — and most casual backtests are — it manufactures confidence in a curve that never existed.
The procedure
- Freeze the rules first. Entry trigger, invalidation, management, written before touching the data. Rules edited while looking at outcomes are being fitted, not tested.
- Walk the data forward. Bar by bar or replayed tick by tick, deciding only on information available at that moment. Scrolling a finished chart and marking the trades you "would" have taken is the look-ahead bias machine.
- Record every signal — including the losers you would rather skip — with entry, stop, exit and R. The skipped-loser habit is how a 0.1R system becomes a backtested 0.8R fantasy.
- Charge costs. Spread on every entry, slippage on stops, swap on holds. On short-timeframe systems costs routinely decide the sign of the result.
- Read the sample honestly: expectancy, win rate, average win/loss, profit factor, maximum losing streak, maximum drawdown — and how many trades stand behind them.
Sample size and regimes
Thirty trades is an anecdote. A few hundred trades, spanning trending and ranging periods and at least one genuinely nasty stretch, begins to be evidence. A strategy tested only on the regime it likes will meet the other one live, at full size.
Overfitting: the quiet killer
Every parameter you tune to the data (this moving average, that session filter, this stop multiple) makes the backtest better and the future worse. Defences: fewer parameters, round numbers instead of optimised ones, testing on data the tuning never saw, and suspicion of any result that looks too smooth. A robust edge survives being slightly wrong about its own settings.
From backtest to live
The backtest's most practical output is the cost of doing business: the losing streak and drawdown you must sit through for the expectancy to show up. Write those numbers down. Live, at small size, your journal becomes the forward test — and the first thing it usually reveals is the gap between the tested system and the executed one.
CLIMB's practice section replays real historical ticks — over 200 major news releases since 2021 — so a rule set can be walked forward against the market as it actually printed, decision by decision, with nothing at risk and every practice trade recorded like a real one.