Quantprove Glossary / Statistics
3 min read

Backtesting

Running a strategy's rules over past prices to see how they would have done.

A backtest replays your rules on historical data and records every trade they would have taken. It's the cheapest way to kill a bad idea, and the easiest way to fool yourself with one that only looks good. Read a strong backtest as the best case your strategy could have had... never as the guaranteed future.

What is backtesting?

You fix the rules first, entry, exit, stop, size and costs, then run them over past prices and collect the trades they produce. From that list come the numbers you judge a system by: expectancy, win rate, maximum drawdown... You can do it by hand, chart by chart, or make software run it, and the same rule applies either way: each decision can only use information that existed at that moment.

What makes a backtest look better than it is?

Almost every mistake pushes the result in the same direction, up:

ProblemWhat it does to the resultHow to catch it
Look ahead biasuses information you wouldn't have had yetenter every trade one candle after its signal and run it again; a big drop means the test was seeing the future
Survivorship biasonly tests what surviveduse the list of instruments that existed on your start date
Data snoopingtries so many versions that one wins by luckcount every version you tested
Overfittingfits the rules to noisetest on data this strategy hasn't seen yet
Missing costsassumes free, perfect fillsadd real trading costs and slippage

None of these shows up as an error. The curve just looks better than the strategy is.

How many trades do you need?

More than most backtests have. With 30 trades you're mostly looking at luck, and a few hundred is where the numbers start to settle. That's why the Edge Score lowers a backtest's score when the sample is small, doesn't matter how good the curve looks.

What can't a backtest tell you?

How the strategy trades with real money. It doesn't know your fees, your nerves or the market you're about to trade in. The next steps are the ones that test it on data it never saw: hold some back for out of sample, roll the test forward with walk forward, then trade it small with forward testing. Expect a gap when you do... live vs backtest covers how big is normal. You can see what a full backtest analysis looks like in the free demo.

Frequently asked questions

Running a strategy's fixed rules over historical prices to see which trades it would have taken and how they would have paid. It gives you expectancy, win rate and drawdown before you risk real money.
  • Expectancy — What one average trade is worth to you, after the wins and losses cancel out.
  • Overfitting — When a strategy is tuned so tightly to the past that it only works on the past.
  • Out of Sample — The data your strategy never saw while you built it, kept back to test if the edge is real.
  • Walk Forward — Out of sample testing done over and over, rolling through your whole history instead of one split.

Turn trading knowledge into evidence.