---
title: "How Backtesting Works | RupeeCase Learn"
description: "What a backtest actually simulates, why most backtests are misleading, and how to read one honestly. Overfitting, survivorship bias."
source_url: "https://www.rupeecase.com/learn/path-2/module-2-4-how-backtesting-works"
---

[Path 02 4 of 5](/learn/path-2/)How Backtesting Works[Next 2.5](/learn/path-2/module-2-5-building-your-first-strategy)

A [backtest](/learn/glossary#backtest) answers one question: "If I had run this strategy on historical data, what would have happened?" It's the only rigorous way to evaluate a systematic strategy before committing real money. No backtest, no basis for conviction.

But backtests are also notoriously easy to abuse. Every strategy looks excellent on the data it was designed on. The skill is building backtests that are honest, and reading other people's backtests with appropriate scepticism. After years of building systematic strategies, I can tell you: most back tests you'll come across are optimistic. Some are outright deceptive.

  1. **Small and live**Real money, small size, before full size.

  2. **Small and live**Real money, small size, before full size.

  3. **Small and live**Real money, small size, before full size.

  4. **Small and live**Real money, small size, before full size.

  5. **Small and live**Real money, small size, before full size.

Skip any one of those and the back test flatters itself. Skipping costs alone can add a couple of percentage points a year to a strategy that trades often, as Module 1.5 showed with real rates.

## What a backtest actually does

      1
Define the rules
Specify signal (e.g., 12M-1M momentum), universe (Nifty 500), portfolio size (top 30 stocks), rebalance frequency (monthly), position sizing (equal weight), and and cost assumptions.

      2
Loop through historical dates
For each rebalance date, apply the rules to data available at that point. Rank all 500 stocks by momentum. Select top 30. Critical: you can only use data that would have been available on that date, not future data.

      3
Simulate trades and costs
Calculate which stocks enter and exit. Apply realistic transaction costs: brokerage, STT (0.1% both sides), exchange charges, GST, stamp duty, and slippage. This is where most back tests fail: they ignore costs or use unrealistically low ones.

      4
Calculate returns and metrics
Track the simulated portfolio value over time. Calculate CAGR, max drawdown, Sharpe, Sortino, alpha. Build the equity curve and underwater plot.

      5
Compare to benchmark
Run the same period for Nifty 500 TRI (Total Return Index, which includes reinvested dividends). Compare CAGR, drawdown, and Sharpe. Alpha = strategy return minus beta-adjusted benchmark expectation.

The key discipline: every calculation at each historical date must use only data available at that point in time. You cannot use today's knowledge to make decisions that were simulated in 2015. This sounds obvious, but it's violated constantly.

## The three biases that make backtests misleading

       Survivorship Bias

      Running a backtest only on stocks that are *currently* in the Nifty 500, without including companies that were in the index historically but later delisted, merged, or went bankrupt. The historical universe looks better than it was because you've removed all the failures.

      **Indian example:** DHFL was once a large, index eligible stock. After its collapse and insolvency, its shares were extinguished and delisted in 2021. Build a back test from today's list of stocks and DHFL simply is not there, so the loss it caused never shows up. The fix is point in time membership: at every past date, use the universe as it actually stood that day.

       Look-Ahead Bias

      Using data that would not have been available at the time of the simulated decision. Under SEBI's listing rules, quarterly results can arrive up to 45 days after the quarter ends, and full year audited results up to 60 days after 31 March. Using June quarter results to make a decision dated 1 July contaminates the back test with information nobody had until mid August.

      **Indian example:** A strategy using March quarter earnings to make April 1 buy decisions is using look-ahead data. Those results could arrive as late as the end of May. The fix is a reporting lag: treat fundamental data as available only after the date it was actually filed with NSE or BSE.

       Overfitting (Data Mining Bias)

      Testing hundreds of parameter combinations, different lookback windows, portfolio sizes, rebalance frequencies, and reporting only the one that performed best historically. Any strategy will look brilliant on the exact data it was optimised on. The question is whether it will work on new, unseen data.

      **How to spot it:** A strategy with very specific parameters ("rebalance on the 8th of each month, use 143-day lookback, hold exactly 17 stocks") is almost certainly overfitted. Robust strategies produce similar results across a *range* of reasonable parameters, the exact value doesn't matter much.

## The honest backtest checklist

+
**Transaction costs included?** Statutory costs alone are about 0.24% of the amount on a delivery round trip, before brokerage and slippage; mid and small caps cost more to trade. A back test without costs is fiction.

+
**Point-in-time constituent data?** Universe at each historical date must reflect what was actually in the index at that time, including companies that later failed.

+
**Realistic reporting lag for fundamentals?** If the strategy uses earnings or balance sheet data, the backtest must respect when results were actually published on NSE/BSE.

+
**Multiple market cycles covered?** A back test that starts in 2021 misses both the 2008 crash and the 2020 fall. Good back tests cover at least one major bear market, or say clearly that they do not.

+
**Parameter robustness shown?** Performance should be similar across adjacent parameter values (9M, 10M, 11M, 12M momentum lookback). If only one exact value works, it's likely overfitted.

×
**Red flag: Only CAGR shown.** No drawdown, Sharpe, or alpha shown? They're hiding unflattering numbers. Every strategy has drawdowns.

×
**Red flag: Sharpe above 2.5 on long-only equity.** NSE's factor indices, measured from 2005 with a 7% risk free rate, sit around 0.5; even strong strategies rarely hold much above 2 for long. Sharpe of 3+ almost certainly means overfitting or a bug.

×
**Red flag: "This is our best parameter set."** If they only show the optimised result without showing how adjacent parameters performed, overfitting is likely.

**The golden rule:** A backtest can tell you what would have happened. It cannot tell you what will happen. Use it to eliminate strategies that couldn't have worked, not to guarantee strategies that will work. The best backtests are honest about this distinction.

[NSE, Historical Data & Corporate Filings (backtest data source)](https://www.nseindia.com/companies-listing/corporate-filings-financial-results)

[NSE Indices, Nifty 500 Historical Constituent Data](https://www.niftyindices.com/indices/equity/broad-based-indices/nifty500)

## A worked example: back calculated versus live

NSE gives you a clean natural experiment. Its factor indices are launched on a date, and NSE also publishes their history from before that date by applying the rules to past data. Everything before launch is a back test. Everything after is live. Look at what happened.

  The long history looked better than the live years
  Total return [CAGR](/learn/glossary#cagr) to 30 Sep 2026: since 2005 (mostly back calculated) against the last 5 years (live)

    1. Nifty 200, last 5 years**8.30%**

    2. Nifty 200, last 5 years**8.30%**

    3. Nifty 200, last 5 years**8.30%**

    4. Nifty 200, last 5 years**8.30%**

    5. Nifty 200, last 5 years**8.30%**

  Source: NSE Indices factsheets, 30 Sep 2026. Nifty200 Momentum 30 launched 25 Aug 2020; NIFTY200 Quality 30 launched 17 Apr 2018. History before launch is NSE's back calculation.

Both indices kept beating or roughly matching their parent universe after launch. Neither came close to the number in its long history. That is not fraud and it is not failure. It is what every honest back test looks like once the future arrives: the edge survives, smaller and bumpier. Size your expectations to the live number, not the brochure number.

Apply the same eye to any strategy, including the ones on RupeeCase. The lineup's strategy pages show a model, back tested history over a rolling window of about five years, starting in 2021. That window does not include 2008 or the 2020 crash. It does include the 2024 to 2025 correction, which is why the worst drawdowns on those pages sit there. Read every figure with the window in mind.

  What would you do?

### A strategy shows 38% CAGR, a Sharpe of 3.1 and no drawdown table. Back tested from 2021. One set of parameters.

    1. **Ask for drawdowns, costs and nearby parameters first**Right questions. If the result holds across nearby settings, includes costs and shows its falls, it deserves a closer look. If not, you have saved yourself the lesson.

    2. **Ask for drawdowns, costs and nearby parameters first**Right questions. If the result holds across nearby settings, includes costs and shows its falls, it deserves a closer look. If not, you have saved yourself the lesson.

  An illustration of the checklist above, not a real product.

## Common mistakes when reading back tests

**Taking the CAGR as a forecast.** It is a description of the past under the rules. The live number is usually lower.

**Ignoring the window.** A five year back test from 2021 and a twenty year one from 2005 are different animals. Check the start date.

**Missing the difference between model and client returns.** A model ignores when you joined, how much you added and what you paid. Your own result will differ.

**Trusting a perfect curve.** Real strategies have ugly years. A smooth line with no falls is a warning, not a comfort.

    **Myth**A back test shows what you would have earned.

    **Fact**It shows what a rule would have earned, on data cleaned after the fact, with costs assumed. Your own result depends on when you start, what you add and what you actually pay.

## How this shows up in RupeeCase

Every return figure on RupeeCase carries the label "Model, back tested" and the date it was checked, and every strategy page shows the drawdowns and the benchmark next to the CAGR. On a strategy chart you can add indices to compare against, as in the screen below, so you can test the comparison yourself instead of taking a headline number.

  Compare on a strategy chart: add the Nifty 500 or a sector index next to the model line. Sample data.

What is walk forward testing?You fit or choose the rules on one stretch of history, test them on the next stretch the rules never saw, then roll the window forward and repeat. It mimics how a strategy actually lives: decided on the past, judged on the future.

How many years of back test are enough?Enough to include at least one full bear market and recovery. In India that usually means going back past 2020, and ideally past 2008. Shorter windows are fine if they are labelled honestly.

Why do my own returns differ from a strategy's model returns?Start date, additions and withdrawals, rounding to whole shares, execution prices and costs all differ from the model. Module 4.4 shows how to measure your own return properly.

What does How Backtesting Works cover?A backtest is a simulation of how a strategy would have performed on historical data. It’s the most powerful tool in systematic investing, and the most abused. This module covers how to use it honestly. It works through What a backtest actually does, The three biases that make backtests misleading, The honest backtest checklist, A worked example: back calculated versus live and more. It is module 2.4 of Path 2, Systematic Investing Fundamentals, about 8 minutes of reading, free.

TTry it

## How Backtesting Works, in numbers.
How long it takes to recover a drawdown at a given CAGR Your numbers, the module's formula, nothing stored.

Calculator

### Drawdown Recovery Calculator
Years required to climb back to a prior peak from a given drawdown at a given CAGR.

Drawdown (%)Forward CAGR (%)

[Full calculator: Drawdown and recovery](/learn/tools/drawdown-recovery-calculator)

  AApply it on RupeeCase

## Allcap Multi Asset
50 stocks, 10% debt, 10% gold. The broad-market engine with a cushion. An index built on the rules this path teaches, multi asset with debt and gold sleeves, held stock by stock in your own demat. Risk band: Moderate.

  [See the strategy](/strategies/allcap-multi-asset)[Sign up for RupeeCase](https://invest.rupeecase.com/signup?strategy=allcap-multi-asset)

  [CAGR40.5%Sharpe1.81Max DD−21.3%Minimum281000Model, back tested, as of 27 Apr 2026. Not client returns, not a promise.](/strategies/allcap-multi-asset)

QQuick check

## 10 questions, 7 to pass.
Pick an answer and the explanation appears. Your result stays on this device and counts towards the Path 02 certificate.

CCheck yourself

## Path 02 so far.
Your quick check results on this device, stop by stop.

1. [TPath test, 31 questionsNot yet](/learn/path-2/module-2-5-building-your-first-strategy#pathTestSection)
2. [TPath test, 31 questionsNot yet](/learn/path-2/module-2-5-building-your-first-strategy#pathTestSection)
3. [TPath test, 31 questionsNot yet](/learn/path-2/module-2-5-building-your-first-strategy#pathTestSection)
4. [TPath test, 31 questionsNot yet](/learn/path-2/module-2-5-building-your-first-strategy#pathTestSection)
5. [TPath test, 31 questionsNot yet](/learn/path-2/module-2-5-building-your-first-strategy#pathTestSection)
6. [TPath test, 31 questionsNot yet](/learn/path-2/module-2-5-building-your-first-strategy#pathTestSection)

    Explore next

## Put the module to work.

* [Blog noteFunds that vanishedCosts: MF, PMS, RupeeCase, a short note](/blog/2026-07-17-morning-funds-that-vanished/)
* [Blog noteSurvivorship bias: the backtest told by the survivorsPortfolio construction, a short note](/blog/2026-06-04-morning-survivorship-bias/)
* [Strategy5Paisa Focused Alpha 5 strategyNifty Alpha 50, 5 stocks, every 3 weeks](/strategies/5paisa-focused-alpha-5)
* [StrategyAllcap strategyNifty Total Market, 50 stocks, every 2 weeks](/strategies/allcap)
* [Blog noteYou sorted by return. Here is what you missed.Strategy notes, a short note](/blog/2026-08-03-evening-sort-by-return/)

      Community

## Join my WhatsApp group.

      Scan the code, fillFill one short form, and join my WhatsApp group. Slides, sources, factsheets and the rebalance logs live there, and members join a daily Google Meet with me.

        [Sign up for RupeeCase](https://invest.rupeecase.com/signup)
        [Join the WhatsApp group](https://forms.gle/C6HMtM1Z2GfeocQV7)

      [One form, one group](https://forms.gle/C6HMtM1Z2GfeocQV7)Scan with your phone camera

SSources

## Where the figures come from.

1. Lopez de Prado, M. (2018). Advances in Financial Machine Learning (chapter on back test overfitting).
2. Lopez de Prado, M. (2018). Advances in Financial Machine Learning (chapter on back test overfitting).
3. Lopez de Prado, M. (2018). Advances in Financial Machine Learning (chapter on back test overfitting).
4. Lopez de Prado, M. (2018). Advances in Financial Machine Learning (chapter on back test overfitting).
5. Lopez de Prado, M. (2018). Advances in Financial Machine Learning (chapter on back test overfitting).
6. Lopez de Prado, M. (2018). Advances in Financial Machine Learning (chapter on back test overfitting).
7. Lopez de Prado, M. (2018). Advances in Financial Machine Learning (chapter on back test overfitting).

GTerms

## 6 terms from this module.
[Backtest](/learn/glossary#backtest)A simulation of how a strategy would have performed if applied to historical data according to its defined rules.
[Survivorship bias](/learn/glossary#survivorship-bias)Distortion from excluding failed/delisted companies from a historical universe, inflating apparent past performance.
Look-ahead biasUsing data in a simulated historical decision that would not actually have been available at that date.
OverfittingDesigning strategy parameters specifically to historical data, producing excellent backtest results but poor forward performance.
Out-of-sample testingEvaluating a strategy on data not used during design. The most reliable test of genuine robustness vs overfitting.
Point-in-time dataHistorical data that accurately reflects what was known at each past date, no contamination from subsequently revealed information.
[All 91 terms in the glossary](/learn/glossary)

[From the podcast archiveEP26: 24,250 Is The Line. Reliance Decides The RestThe Tanmay Edge, 24 Apr 2026, graded 2/5](/podcast/episodes/2026-04-24)[Pillar guideSystematic Investing18 modules across paths 2, 3, 5](/learn/systematic-investing)

Education only, not investment advice. RupeeCase is a technology platform operated by QC Alpha Technologies Pvt Ltd; it is not a fund, a PMS or a SEBI registered investment adviser. Model returns are back tested and not a promise of future returns. Figures carry the date they were checked.
