QQ 201, 2 min read
What a backtest is
After this lesson you can
- List the three inputs of a backtest
- Say what a backtest can and cannot establish
- Name five reasons a profitable backtest may not be an edge
A backtest applies a set of trading rules to past prices and records what would have happened. It is a simulation. No order was placed and none was filled.
What goes in
- Rules exact enough for a computer to follow: when to enter, when to exit, how much.
- Data: a price history for the market.
- Assumptions about fills and costs: what price you get, what you pay.
Change any one of these and the result changes. Most disagreements between two backtests of the same idea come from the third.
What comes out
A list of trades, an equity curve, and summary numbers such as net profit, Sharpe ratio and maximum drawdown.
What it is good for
A backtest is good at saying no. If an idea loses money on twenty years of history with realistic costs, that is strong evidence against it.
It is weak at saying yes. A profitable backtest has several explanations other than a real edge:
- the rules used information that was not available at the time
- the rules were tuned until they fit this history
- costs were left out
- it was the best of many tries
- the period happened to suit it
The rest of this module takes those one at a time. How the terminal runs a backtest, step by step, is in How a backtest runs here.
Key points
- A backtest is a simulation, not a record
- It is strong evidence against an idea and weak evidence for one
- Most disagreements between backtests come from fill and cost assumptions
Check your understanding
Which conclusion does a backtest support most strongly?
Two people backtest the same rules on the same data and get different results. What is the most likely reason?
Further reading
- Pardo, R. (2008). The Evaluation and Optimization of Trading Strategies, 2nd edition. Wiley.
- Lopez de Prado, M. (2018). Advances in Financial Machine Learning. Wiley. The chapters on the dangers of backtesting.