Stock Market · Trading Systems
Backtesting basics
Backtesting is running your strategy against historical data to see how it would have performed. Done right, it's the most powerful tool for evaluating strategies. Done wrong, it's a recipe for overconfidence and inevitable losses.
What backtesting tells you
- Historical win rate
- Average profit per trade
- Maximum drawdown
- Profit factor (gross wins / gross losses)
- Number of trades per year
Required data for honest backtest
- Long sample size: 5+ years of historical data
- Bull, bear, and sideways markets included
- All trades counted, including the ones you wouldn't have taken in real-time
- Brokerage, STT, slippage included
Tools
- TradingView Strategy Tester (entry-level)
- Amibroker (powerful but learning curve)
- Python backtesting libraries (Backtrader, Zipline) for serious users
- Excel for simple manual backtests of 30-50 trades
Pitfall 1: data snooping
Testing 100 indicator combinations until you find one that 'works' historically. By chance, some combinations will look great on past data but fail in real-time.
Pitfall 2: survivorship bias
Testing on today's Nifty 50 stocks ignores the companies that dropped out of the index after performing badly. Your backtest only sees winners.
Pitfall 3: ignoring costs
A strategy that makes ₹100 per trade looks great. But if brokerage + STT + slippage = ₹80 per trade, real-world profit is ₹20. Quarter the headline number.
> A backtest that doesn't include realistic transaction costs is a fairy tale.
Read the metrics, not just the equity curve
Profit factor > 1.5 = decent. Profit factor > 2 = strong. Max drawdown < 20% = manageable.
Takeaway. Backtest with 5+ years of data including bull/bear/sideways markets. Include realistic costs (brokerage, STT, slippage). Watch for data snooping, survivorship bias, and ignored costs. They make backtests lie.
Reading is step one. Playing is how it sticks.
Get a virtual net worth and live this exact concept in daily scenarios. ₹0 real risk.
Play it free →