Anyone can produce a beautiful backtest. Give me enough parameters and a fixed slice of history and I'll show you an equity curve that goes up and to the right forever. It will also fall apart the moment real money touches it.
How do you backtest a trading strategy?
Write the rules down precisely enough that two people would take identical trades, then apply them bar by bar across historical data without skipping ahead. Record every trade including losers, subtract realistic costs, and judge the result by expectancy and drawdown — not by the total profit figure.
Step one: rules a stranger could follow
If your rule is "buy when the trend looks strong," you don't have a strategy, you have a preference. Every element needs to be unambiguous: what constitutes the setup, the exact entry trigger, where the stop goes, how the exit works, what size, and — critically — what disqualifies a trade.
The test: hand your rules to someone else. If they'd take a meaningfully different set of trades, the ambiguity is doing your "edge" for you.
Step two: the biases that manufacture fake results
| Bias | What it looks like | Fix |
|---|---|---|
| Lookahead | Using information the bar hadn't produced yet (a close price to enter at the open) | Step forward bar by bar; hide the future |
| Overfitting | Tuning parameters until history looks perfect | Few parameters; test on data you didn't tune on |
| Survivorship | Testing only on names that still exist today | Use datasets including delisted names, or acknowledge the skew |
| Ignoring costs | Assuming perfect fills, no spread or slippage | Subtract realistic per-trade costs from every result |
| Cherry-picked window | Testing a trend strategy only across a bull market | Include a range period, a crash, and a chop period |
Overfitting is the one that gets nearly everyone, because it feels like diligence. Each tweak improves the curve, so each tweak seems like progress. In reality you're memorising the noise of one particular stretch of history. A strategy with three parameters that works acceptably across many periods beats one with nine parameters that works beautifully across one.
Step three: judge the right numbers
Total profit is the least informative output. What matters:
- Expectancy per trade after costs — the average result of one trade, expressed in risk units.
- Maximum drawdown — the worst peak-to-trough loss. This is the number that decides whether you can actually run the thing. Recovering from a deep hole is mathematically brutal.
- Sample size — thirty trades tells you almost nothing. You want hundreds before you believe anything.
- Longest losing streak — because you'll have to sit through it live, with real money.
Step four: forward-test before you fund it
A backtest is a hypothesis. Forward-testing — running the rules on unseen data or in real time on paper — is the closest you get to evidence without paying tuition. It also surfaces the practical problems a backtest can't: whether you can actually spot the setup live, whether the fills exist, whether you'll follow the rules when it's your money.
Then start small. Real capital at a fraction of intended size tells you things paper trading never will, mostly about yourself.
Frequently asked questions
How many trades do I need for a valid backtest? More than feels necessary. A few hundred across varied conditions gives a rough read; small samples mostly measure luck.
Can I backtest by hand? Yes, and it's underrated for learning. Scroll historical charts bar by bar, log each trade honestly, and you'll understand the strategy far better than a script output tells you.
Does a good backtest mean the strategy will work? No. It means the idea isn't obviously broken. Markets change regime, and past behaviour is evidence, not a guarantee.
Testing an idea properly — then sizing it so a bad run doesn't end you — is the difference between a hobby and a process. The Asymmetric Trader's Playbook covers testing, expectancy, and the risk engine around them, $29 (reg. $39). Educational material, not financial advice, with no promise of profit.
Related: how to write a trading plan and the Make Money guides.