

Kotak
Stockshaala
Chapter 1 | 2 min read
Backtesting with Historical Data
Before you trust any stock screener, you need to ask:
“Has this worked in the past?”
That’s what backtesting is all about. It’s the process of running your rules or prompts on past market data to see how they would have performed.
If a screener shows good results in history, it’s not a guarantee — but it gives you confidence to try it in the present.
What is Backtesting?
Backtesting means applying your screening rules to historical stock data — prices, volumes, fundamentals — and checking the outcomes.
It answers questions like:
- Would this strategy have made money?
- How often did it fail?
- What was the risk level?
Think of it as a rehearsal before the live show.
Why It Matters
Without backtesting, every screener is just a guess. You don’t know if it worked in bull markets, sideways phases, or crashes.
Example:
A rule like “Buy stocks when RSI drops below 30” may look good in theory.
But when tested on 10 years of Nifty 50 data, it might show that it only worked well during strong uptrends.
That insight can save you from blindly following it in the wrong conditions.
How to Do It
- Pick a time range: 5 years, 10 years, or a mix of market cycles.
- Run your screener rules on that data.
- Track the results: How many stocks qualified, how many actually did well?
- Compare with benchmarks like Nifty 50 or Sensex.
Example Prompt:
“Test this screener — mid-cap IT stocks with profit growth > 10% and trading above 200-DMA — on data from 2015 to 2020.”
Key Metrics to Check
- Win rate: % of times the rule worked.
- Average return: Did it beat the benchmark?
- Drawdowns: How much did it lose in bad phases?
- Consistency: Did it work across different sectors and years?
Limitations
- Past performance doesn’t guarantee future results.
- Overfitting risk: A screener can look perfect in backtests but fail later.
- Data quality matters — wrong or incomplete data = misleading results.
Final Takeaway
Backtesting is your safety net.
It tells you whether a screener had merit in the past before you risk money today.
But remember — markets evolve.
Use backtesting as a guide, not a promise.
The real value lies in spotting patterns that make sense across cycles, not in chasing strategies that only shine in history.
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.














