What is backtesting and how to do it without fooling yourself
Backtesting means testing a strategy on historical data to see how it would have performed before risking real money. It's the bridge between "I have an idea" and "I trust my method". Done well, it gives you founded confidence. Done badly, it gives you false confidence that the market takes care of charging for. Here's the difference.
Why it's essential
Trading a strategy without having tested it is gambling. Backtesting answers critical questions before they cost you money: does this strategy win long term? How many losses in a row can it string together? Would my psychology survive that streak? Knowing a system had 8 losses in a row in the past prepares you for when it happens live, instead of abandoning it on the seventh.
How to do it well
- Rules defined in detail: if you can't write exactly when you enter and exit, you can't test it. Ambiguity is the door to self-deception.
- Large sample: 10 trades say nothing. Aim for at least 50-100 so the results have statistical meaning.
- Include the costs: spread, commissions and slippage. Many strategies that look profitable die when you subtract real costs.
- Different conditions: test in bull, bear and sideways markets. A strategy that only works in a trend will ruin you in a range.
The traps that fool you
Backtesting has a silent enemy: bias. The most dangerous is hindsight bias: looking at the already-formed chart and believing "it was obviously a buy there". Live, with the candle forming and not knowing what's coming, it's not obvious at all. Another trap is over-optimising: adjusting the parameters to past data so much that the strategy works wonderfully in the history and terribly live. If your system needs very specific numbers to work, it's probably overfitted.
The typical mistake: testing until it looks pretty
It's tempting to change the rules over and over until the historical result shines. But that's not backtesting, it's drawing the target around the arrow. An honest system is defined before testing, and you accept whatever result it gives. If you have to tweak it twenty times to make it win, what you've found isn't a strategy: it's a coincidence of the past that won't repeat.
Where to start
Take a simple, clear strategy, define its rules in writing, and test it by hand over 50 trades of your historical chart. Record each one as if it were real. Manual backtesting is slow, but it teaches you to "see" your strategy in action far better than any automatic software. And that understanding is what will give you the calm to follow it when the bad streak comes.