EquitiesIndia.com
Technical AnalysisHistorical Strategy TestingStrategy Backtesting

Backtesting (Concept)

Backtesting is the process of applying a defined trading strategy to historical price data to evaluate how that strategy would have performed in the past, used as a research tool to assess strategy viability before committing real capital.

Backtesting transforms a trading idea — described in precise, rule-based terms — into a historical simulation. The inputs are a complete ruleset (entry conditions, exit conditions, position sizing, and stop-loss logic), a historical price dataset, and assumptions about execution quality. The output is a performance report showing metrics such as total return, maximum drawdown, win rate, profit factor, and Sharpe ratio over the tested period.

For Indian equity markets, historical daily OHLCV (Open, High, Low, Close, Volume) data for NSE and BSE stocks was available through data vendors such as Quandl, NSE Data Portal, and various brokerages offering API access. Intraday historical data (1-minute or tick data) was available through providers such as Zerodha Historical Data API, Upstox, and Truedata — essential for backtesting intraday strategies.

Survivorship bias is the most critical conceptual error in backtesting. If a database only contains stocks that currently exist, it automatically excludes companies that were delisted, went bankrupt, or were removed from indices during the study period. Testing a momentum strategy on only the current Nifty 500 constituents without including historical companies that were later replaced would overstate returns, because the test universe only contains the stocks that survived — the ones that, in hindsight, tended to perform well.

Curve fitting — also called overfitting — is the second major pitfall. When a strategy is developed by testing thousands of parameter combinations and selecting the best-performing set, the resulting parameters are often perfectly tuned to the specific historical noise in the dataset rather than a genuine repeating pattern. Out-of-sample testing and walk-forward optimisation were used to detect overfitting: if a strategy that performed brilliantly on the training data significantly underperformed on a holdout period not seen during development, it was likely overfitted.

Execution assumptions matter significantly. Backtests assuming you could always enter at the next-bar open at the close price signal are unrealistic. Realistic backtesting incorporated slippage (the difference between the theoretical entry price and the actual achievable fill price), brokerage commissions, and the bid-ask spread. For Indian intraday strategies, SEBI transaction charges, STT, and exchange fees could meaningfully affect the net P&L of high-frequency strategies.

Educational only. This glossary entry is for informational purposes and does not constitute investment, tax, or legal guidance. Please consult a SEBI-registered adviser before making any investment decision.