There is no feeling more intoxicating than a backtest equity curve that points straight up at a 45-degree angle. "I’ve cracked the code," you think. "I’m going to be rich."
Then you deploy it. Week 1: Flat. Week 2: Loss. Week 3: Big Loss.
What happened? You fell for the Backtest Illusion. A backtest is a simulation of what would have happened, assuming perfect conditions. But the market is never perfect.
1. Overfitting (Curve Fitting)
This is the cardinal sin. You have a moving average strategy. You test it with a 20-period MA. It loses. You try 21. You try 22. Eventually, you find that 24.5 was the perfect number for the last 2 years.
You didn't find a market principle; you found a coincidence. You "fitted" your curve to the noise of the past. The future is random, and your specific parameter of 24.5 will likely fail tomorrow.
2. Look-Ahead Bias
This happens when your code accidentally uses information from the future to make a decision in the past.
Example: "Buy if the Close is greater than Open."
In backtesting, you know the "Close" of the candle as soon as the candle opens. In real life,
you don't know the Close until the candle ends. If you execute at the Close price,
you are cheating.
3. The Silent Killer: Slippage & Impact Cost
Your backtest assumes that if the price hit 100, you bought at 100.
In reality, if you try to buy 1000 lots of Options, you won't get them all at 100. You might get 50 at 100, 200 at 100.5, and the rest at 101. Your average price drifts up.
For high-frequency strategies (scalping), slippage often eats 100% of the theoretical edge. If your average profit per trade is ₹500 and your slippage cost is ₹200, you are barely breaking even after taxes.
How to Validate Properly
- Out-of-Sample Testing: Optimize your strategy on data from 2020-2022. Then, run it on 2023 data without changing a single number. If it fails there, it's garbage.
- Monte Carlo Simulation: Randomize the order of your trades. Does the strategy still survive?
- Stress Testing: Add artificial lag (e.g., 2 seconds) and artificial fees to your backtest. Does it still make money?
Need a Reality Check?
Don't burn capital on a flawed algorithm. Our Backtest Validation Service puts your strategy through a rigorous stress test to tell you if it's truly alpha—or just an illusion.