Backtesting runs a set of trading rules on historical data to see how they would have performed. Done carefully it filters out ideas that never worked; done carelessly it produces false confidence.
- Write the rules down. Entry, exit, stop-loss, target and position size must be unambiguous.
- Avoid look-ahead. Read signals on bar close and trade the next bar’s open.
- Include costs. Brokerage, STT, exchange charges and slippage can turn a small edge into a loss.
- Use enough data. At least a few years and ideally both rising and falling markets.
- Judge the risk, not just the return. Look at max drawdown, Sharpe and the longest losing streak.
- Beware of over-optimising. If a result only works with one perfect parameter, it is probably curve fitting. Prefer plateaus where nearby settings also work.
- Test out of sample, then paper trade. Reserve a period you did not optimise on, then run the strategy live on paper before risking money.
Backtests are research tools. They never guarantee future results.