What is backtesting?

Backtesting is the process of applying a set of investment rules to historical market data to see how those rules would have performed in the past. Instead of guessing whether a strategy is good, you run it against years of actual price and fundamental data and measure the result.

For example: "Buy the top 20 NSE stocks by 12-month price momentum and rebalance every month" — backtesting tells you what CAGR, drawdown, and Sharpe ratio that rule would have produced from 2015 to 2024.

Key principle: Backtesting does not predict the future. It tells you how a rule behaved in the past under specific market conditions. Past performance is not a guarantee of future results.

Why does backtesting matter for Indian investors?

Most retail investors in India make decisions based on tips, news, or gut feeling. Backtesting introduces a discipline of evidence — you form a hypothesis, test it against data, and see what actually happened rather than what you imagined.

The Indian stock market (NSE/BSE) has now accumulated over 20 years of reliable price data for large and mid-cap stocks, making it feasible to test strategies across multiple market cycles — the 2008 crash, the 2013 currency crisis, the 2020 COVID collapse, and the 2021–2022 bull run.

How a basic backtest works — step by step

  1. Choose a universe — which stocks are eligible? NIFTY50, NIFTY200, or a custom list.
  2. Define the strategy rule — a ranking or filter expression. E.g., rank by ROE / PE and buy the top 15.
  3. Set the date range — how many years of history to test across.
  4. Configure rebalancing — monthly, quarterly, or another frequency.
  5. Run the backtest — the engine simulates buying and selling on each rebalance date using historical prices.
  6. Analyse results — CAGR, Sharpe ratio, maximum drawdown, year-by-year returns.

What can you learn from a backtest?

A well-run backtest surfaces several things:

Common mistakes beginners make

Overfitting

Tuning a strategy until it looks great on past data is called overfitting. If you test 50 variations and pick the best one, you've likely found a pattern that is specific to historical noise, not a real edge. A robust strategy should work across a range of parameters, not just one perfect setting.

Survivorship bias

If your backtest only includes stocks that exist today, you're testing on survivors — companies that didn't go bankrupt, get delisted, or get acquired. This inflates historical returns. Proper backtesting uses point-in-time universe membership: only stocks that were available on the rebalance date are included.

Look-ahead bias

Using data that wouldn't have been available at the time of a trade — for example, using a company's annual report figures before they were actually published — is called look-ahead bias. It makes a strategy look better than it could ever be in reality.

Ignoring transaction costs

Every trade has brokerage fees, STT (Securities Transaction Tax), and slippage (the difference between the price you expect and the price you get). For high-turnover strategies these costs materially reduce returns.

Backtesting on NSE with ftInvstr

ftInvstr is built specifically for Indian equity backtesting. The platform uses point-in-time NSE universe membership to avoid survivorship bias, supports NIFTY50, NIFTY100, and NIFTY200 universes, and lets you write strategy rules in a plain-English expression language with 50+ supported functions — technical indicators, fundamental ratios, momentum signals, and more.

Results show CAGR, Sharpe, Sortino, maximum drawdown, and a year-by-year breakdown so you can see not just the headline number but how the strategy behaved in every market condition.

Run your first backtest on NSE stocks

No coding required. Write a plain-English strategy rule and see how it would have performed on historical Indian equity data.

Start free — no credit card needed

Summary

Backtesting is one of the most powerful tools available to an individual investor. Used correctly — with proper controls for survivorship bias, look-ahead bias, and overfitting — it lets you evaluate ideas objectively before risking real capital. It is not a crystal ball, but it is a rigorous filter that separates plausible ideas from historically validated ones.