Backtesting – The Holy Grail?
The internet is full of anecdotal evidence with charts and explanations. However, very little is tested by 100% defined and quantified rules. This is why you want to backtest! Moreover, it gives you 100% neutral feedback in your performance.
If you want to be an automatic and systematic trader, you need to understand all aspects of backtesting:
What is backtesting?
A backtest has strict rules for when to buy and when to exit. In other words, you can code the strategy and find out with 100% certainty how the strategy has performed in the past. Thus, this is a backtest on historical data. You form a hypothesis, make strict buy and sell signals, and you run backtests to see how our ideas performed in the past.
Of course, this doesn’t give any certainties about the future, but you know if the strategy has performed well or poorly in the past. If something has performed poorly in the past it’s unlikely that it will perform well in the future. However, the ever-changing market cycles make strategies perform well in certain markets, and poorly in others. This is the reality of trading.
Opposite, if a backtest proves that your idea has worked well in the past, it most likely will perform better than any idea that has performed poorly. But of course, a positive backtest is no guarantee that it will work in the future. But we believe it’s the best indication you can get.
A backtest follows this procedure:
- Find an idea you want to test.
- Define clear and concise entry and exit parameters – they need to be quantifiable.
- Specify the market you want to test on.
- Specify the time frame you want to test.
- Code the strategy.
- Run the strategy on the in-sample period.
- Test the out of sample backtest (see separate lesson).
This is all there is to it.
Backtesting works because you can easily check if something has worked in the past or not.
- Is, for example, the Turnaround Tuesday true or just a myth? Just define the rules and start the backtest. You’ll find out in five minutes.
- Do you believe you see an interesting pattern in the chart? Then quantify it with strict buy and sell rules and test it.
Did the strategy work in the past? If something has not worked in the past, you can easily falsify your hypothesis and go on to test another idea.
Advantages with backtesting
There are multiple advantages to backtesting:
- You can automate and trade multiple systems, even hundreds of systems at the same time.
- You can exploit the law of large numbers.
- It removes emotions and procrastination, and thus reduces trading biases.
- It saves you time.
- You gain leverage in systems you can trade.
