A useful backtest follows a deliberate process, not just a quick scan through a chart looking for a pattern that seems to work. The steps below are designed specifically to avoid overfitting, look-ahead bias, and the other pitfalls covered in the previous lesson — skipping any of them tends to reintroduce the exact problems this process exists to prevent.
Write the rules down completely, before testing
Every entry condition, exit condition, stop-loss placement, and position-sizing rule needs to be specific enough that someone else could follow it mechanically. If a rule involves judgment calls ("exit when it feels like momentum is fading"), it can't be backtested honestly — vague rules always fit history better than they'll perform live.
Use clean, complete historical data
Confirm the data source doesn't have gaps, doesn't exclude delisted or discontinued instruments, and reflects actual tradable prices rather than a theoretical index. Low-quality data quietly invalidates everything built on top of it.
Test across multiple market conditions
Run the strategy across trending periods, ranging periods, high-volatility periods, and calm periods separately, not just one long combined test. A strategy that only works in one type of condition needs a plan for what to do when that condition ends — or an honest acknowledgment that it's condition-specific.
Include realistic costs in every result
Apply the spread, a reasonable commission estimate, and an allowance for slippage to every simulated trade. A strategy that's only profitable with zero costs applied isn't a strategy — it's a rounding error away from a loss.
Reserve untouched data for out-of-sample testing
Before building or tuning the strategy, set aside a portion of the historical data you won't look at until the rules are finalized. Testing the finished strategy on this untouched period is the closest a backtest can get to simulating genuinely unseen data.
Forward test on a demo account before risking capital
A strategy that survives a rigorous backtest still hasn't been tested on live, real-time data. Running it on a demo account for a meaningful stretch — under real market conditions, without the benefit of hindsight — is the step most traders skip and the one that matters most.
What to actually measure
A backtest that only reports total return misses most of what matters. These are the statistics worth tracking alongside it:
A sample equity curve — reading the drawdown
Illustrative data. The equity curve trends upward overall, but the shaded stretch — a 28% decline from peak to trough — is what "maximum drawdown" actually looks like lived through in real time, not just as a number in a table.
| Metric | Why it matters |
|---|---|
| Number of trades | Too few trades means the result could easily be chance, not edge |
| Win rate | Useful only alongside average win/loss size — a low win rate can still be very profitable |
| Average win vs. average loss | Shows whether wins are meaningfully larger than losses, or barely covering costs |
| Maximum drawdown | The worst peak-to-trough decline — tells you what you'd need to psychologically and financially survive |
| Longest losing streak | A realistic preview of what a bad stretch actually looks like in practice |
When to stop trusting a backtest
If a strategy needed many rounds of parameter tweaking to finally show a good result, that's a sign of overfitting regardless of how good the final number looks. A strategy built on a simple, explainable piece of market logic that performs reasonably — not perfectly — across multiple conditions and an out-of-sample period is far more trustworthy than one with a spectacular result that required extensive tuning to achieve.