Overfitting is the most common and dangerous mistake in strategy development. It occurs when a strategy is so perfectly tuned to historical data that it fails completely in live trading.
Signs Your Strategy is Overfit
| Red Flag | Example |
|---|---|
| Too many parameters | SMA 17 crossing SMA 43 (why not 20/50?) |
| Perfect results | 90%+ win rate with tiny drawdowns |
| Only works on one stock | Great on RELIANCE, fails on everything else |
| Complex rules | 10+ conditions to enter a trade |
| Specific time periods | Only works from 2018-2020 |
How to Avoid Overfitting
Rule 1: Keep It Simple
The best strategies are often the simplest. Limit yourself to 2-3 conditions maximum.
| Overfit Strategy | Robust Strategy |
|---|---|
| RSI 13 < 28 AND SMA 17 > SMA 43 AND MACD > 0.5 AND Volume > 1.2M | RSI 14 < 30 AND Close > SMA 200 |
Rule 2: Use Standard Parameters
Stick to commonly used indicator periods:
| Indicator | Standard Values | Avoid |
|---|---|---|
| SMA/EMA | 10, 20, 50, 100, 200 | 17, 43, 67 |
| RSI | 14 | 11, 13, 17 |
| MACD | 12, 26, 9 | 10, 22, 7 |
| Bollinger | 20, 2 | 15, 1.7 |
Rule 3: Test on Multiple Stocks
A robust strategy should work across similar stocks:
- If it only works on RELIANCE but not TCS, INFY, or HDFC → Overfit
- If it works on 7 out of 10 large-cap stocks → More likely robust
Rule 4: Out-of-Sample Testing
- Develop strategy on 70% of data (2015-2021)
- Test on remaining 30% (2022-2024)
- If performance drops significantly → Strategy is overfit
Rule 5: Expect Realistic Returns
| Metric | Realistic | Likely Overfit |
|---|---|---|
| Annual Return | 15-30% | 100%+ |
| Win Rate | 40-60% | 80%+ |
| Max Drawdown | 15-30% | <5% |
| Sharpe Ratio | 1.0-2.0 | 3.0+ |
Building Robust Strategies
Focus on strategies based on proven market logic:
- Trend following: Prices tend to continue (momentum)
- Mean reversion: Prices return to average
- Breakouts: Price breaks through key levels
These concepts have worked across markets and time periods because they're based on human psychology, not data mining.
Quick Checklist Before Trading Live
- ☐ Strategy has 3 or fewer conditions
- ☐ Uses standard indicator parameters
- ☐ Works on multiple similar stocks
- ☐ Tested on out-of-sample data
- ☐ Returns are realistic (not too good to be true)
- ☐ You can explain the logic in plain English
