

Kotak
Stockshaala
Chapter 5 | 4 min read
Backtesting Do’s & Don’ts (Bias, Interpretation, Metrics)
Backtesting helps you answer one key question:
“Would this strategy have worked in the past?”
But interpreting backtest results the wrong way can lead to overconfidence, bad trades, or strategies that fall apart in live markets.
This chapter covers:
- What to check in your backtest report
- What mistakes to avoid
- How to interpret the data with a clear head
What to Look for in a Backtest Report
Once you run your strategy in TradingView’s Strategy Tester, you’ll see a summary. Focus on these key metrics:
Net Profit | Total gains/losses over the test period |
Win Rate (%) | % of trades that were profitable |
Max Drawdown | Biggest drop in capital during the period |
Profit Factor | Total profit ÷ total loss (>1 = good) |
Number of Trades | Sample size—too few = unreliable |
Average Trade % | Average gain/loss per trade (watch for extremes) |
The Most Common Backtesting Mistakes
Let’s call them out directly.
1. Overfitting the Strategy
You tweak the settings so much that it “looks perfect” on past data—but breaks in real life.
How to avoid:
Don’t chase the best settings. Instead, look for consistently okay results across different stocks and timeframes.
2. Ignoring Sample Size
You test only 10 trades, and it looks profitable.
Why it’s risky:
That could be pure luck. A strong strategy needs at least 30–50 trades over varied conditions to mean anything.
3. Using Future Data (Lookahead Bias)
This happens when your strategy accidentally uses information that isn’t available yet for example, when it makes trading decisions using future candle data on the same bar.
How to avoid it:
- Always base your logic on completed candles, not live ones. Example: use ta.crossover() instead of comparing price values mid-bar.
- Be extra careful when using data from higher timeframes (like daily data on an hourly chart). Higher-timeframe data updates only after its candle closes, so it can appear to “change” on lower charts as new data comes in.
In short:
Build your strategy so it reacts only after a bar closes and uses confirmed data and not values that can still update later.
4. Misunderstanding Drawdown
You see a ₹10,000 profit and get excited—but ignore that the strategy dropped ₹5,000 halfway through.
What to do:
Always check Max Drawdown. If the strategy takes wild swings, it may not be practical even if it's profitable on paper.
Do This Instead
Use realistic stop-loss/targets | Keeps results grounded in actual execution |
Test across market types | Bullish, sideways, and volatile markets matter |
Limit trades per day/week | Reflects how often you'd actually trade |
Combine metrics, not just profit | Win rate + drawdown + trade count = full picture |
Interpreting a Realistic Backtest
Say your strategy shows:
- Net profit: ₹12,000
- Win rate: 48%
- Profit factor: 1.5
- Drawdown: ₹3,000
- Trades taken: 60 over 6 months
That’s a solid foundation.
It’s not “perfect,” but it’s repeatable. Not based on luck, and hence leaves room to optimize position sizing, filtering, or alerts.
To Sum Up
A backtest is a guide, not a guarantee.
Use it to validate ideas, spot weaknesses, and build confidence, but never treat it as foolproof.
Smart backtesters build good strategies.
Blind optimizers build traps.
Note: Pine Script™ is a trademark of TradingView Inc.
Recommended Courses for you
Beyond Stockshaala
Discover our extensive knowledge center
Learn, Invest, and Grow with Kotak Videos
Explore our comprehensive video library that blends expert market insights with Kotak's innovative financial solutions to support your goals.














