What a backtest is
A backtest applies precisely defined trading rules to historical data to see how they would have performed. It has four parts: the data, the rules, an execution model (how orders would have filled, with fees and slippage), and the metrics used to judge the result. A weakness in any one part makes the whole result unreliable.
The biases that flatter results
Most impressive backtests are impressive because of a bias:
- Lookahead bias — using information that was not available at the time, such as a candle's close before the candle ended.
- Overfitting — tuning many parameters until the rules match past noise.
- Data snooping — testing hundreds of ideas and reporting only the best one.
- Unrealistic execution — assuming fills at exact prices with no fees or slippage.
- Survivorship bias — testing only on assets that still exist today.
Validation
Keep part of the data out of sample: design the rules on one period and evaluate them on a later one you did not look at. Walk-forward testing repeats this process through time. Check how sensitive results are to small parameter changes — a robust idea should not collapse when a moving average changes from 50 to 55 periods.
Count the trades. A strategy with a dozen trades tells you very little, however good its returns look.
Metrics that matter
Judge a strategy on several dimensions, never on return alone:
- Total return compared with simply buying and holding over the same period.
- Maximum drawdown and time spent in drawdown.
- Win rate together with the average win and average loss.
- Profit factor and expectancy per trade.
- Exposure — how much of the time capital was at risk.
Backtesting in XRP Terminal
Strategy Lab computes indicators causally, applies fees and slippage, and compares results with a buy-and-hold benchmark. Its results are simulations on historical data: they show how rules behaved in the past, not how they will behave in future markets.
Reading the equity curve
Look beyond the final number. A curve whose profit comes from two or three enormous trades may depend on luck. Long flat stretches test patience in a way a summary statistic hides. Clusters of losses reveal regime dependence. Compare the worst drawdown with what you could tolerate financially and emotionally — live drawdowns frequently exceed the backtested maximum.
Key takeaways
- A backtest is only as good as its data, rules, execution model and metrics.
- Lookahead and overfitting are the most common flaws.
- Validate out of sample and check parameter sensitivity.
- Judge drawdowns and trade count, not just returns.
- Always compare with buy-and-hold.