TRADING / PRACTICAL GUIDE
Backtesting Trading Strategies Without Cheating
Learn how rules, costs, look-ahead bias and out-of-sample testing affect a backtest.
The short answer: A backtest applies defined rules to historical data. It can show how those rules would have behaved under the data and assumptions used. It cannot prove future profitability.
Make every rule executable
Replace phrases such as “strong trend” with measurable conditions. Specify the universe, timeframe, entry, exit, sizing and what happens when data are missing.
Include frictions
Commissions, spreads, slippage, borrowing costs and delayed fills can change an attractive result. Use assumptions that reflect the instruments and trade frequency.
Block look-ahead bias
A decision may use only information available at that moment. Revised data, future constituents and end-of-bar values used before the bar closes can leak the future into the test.
Reserve unseen data
Develop on one period and evaluate on another. Repeatedly adjusting rules to the test period turns it into training data. Prefer a stable idea that survives several conditions over the prettiest equity curve.
Put it into practice
Try this: Write one strategy rule so precisely that another person could code it. List every data item the decision is allowed to use at that moment.
Sources and further reading
Continue learning
Educational purpose: This guide provides general education. It does not provide personalised financial, investment, legal or tax advice.