Look at India VIX on two days. On 24 Nov 2025 it closed at 13.24. On 22 Apr 2026 it closed at 18.30, after standing at 12.25 on 4 Feb. A volatility rule tuned on the quiet autumn would meet that spring as a stranger. Walk forward testing is the method that makes a rule meet strangers on purpose. It fits the rule on one stretch of history, trades the next stretch it has never seen, then slides forward and does it again. This lesson sets out the method on the 300 sessions in the school's files, shows the four test windows they give and what each window holds, and says what the method cannot fix. The rule in the example is made up, and nothing here is a view on where Nifty goes.

3By the end you can

  1. Split data into fit and test parts and say when a test part stops being out of sample.
  2. Work out folds, tested sessions and efficiency for a walk forward run.
  3. Name leakage, an embargo and the signs that a fit is chasing noise.
The RupeeCase terminal on sample data: The key figures card: what are the four lead figures?
Watch in the terminal: what are the four lead figures? A short tutorial on sample data.

The idea, plainly

What is out of sample testing?

Split the history in two. Fit the rule, and every parameter in it, on the first part. Then run it once on the second part, with nothing changed. The second part is out of sample: the rule has not seen it. The split has one strict law. The moment a result on the second part makes you change the rule, that part has become in sample, because it shaped the choice. A common way a backtest fails is a test set that was looked at before it was used. The lesson on biases explains why a version count matters, and a clean out of sample test is one guard against it.

What is walk forward testing?

A single split uses the test part once. Walk forward repeats the split along the calendar. Fit on a training window of 100 sessions, freeze the parameters, trade the next 50 sessions, record the result, then move the windows forward by 50 sessions and fit again. The test windows never overlap, and each is traded with parameters that were fitted only on the past. Joined end to end, they form one out of sample record. With 300 sessions this gives 4 folds, so 200 sessions are tested out of sample, 66.7% of the data. A single split that fits on 70% of the data tests 90.

Each fold fits first, freezes, and only then meets new data

Walk forward testing loops through five steps: fit on a training window, freeze the parameters, trade the next window, record it, then slide forward and fit againDiagram with 5 boxes. Fit to Freeze; Freeze to Trade the next window; Trade the next window to Record; Record to Slide forward.Fitparameters on the trainingwindowFreezeno change from hereTrade the next windowdata the fit never sawRecordresults and trades of thatfoldSlide forwardby one test window, then fitagain
The loop repeats until the history runs out. The joined test windows are the out of sample record. The training window may roll forward, or anchor at the start and grow. Source: RupeeCase illustration of walk forward testing. As of 17 Oct 2026.

Walk forward tests 66.7% of the sessions out of sample

Sessions tested out of sample: a single split tests 90 of 300 sessions and walk forward with 4 folds tests 200Single split 90; Walk forward 200.Sessions tested out of sample, of the sessions in the filesSingle split90Walk forward200
The count is of Nifty trading sessions in the school's files, from 1 Jul 2025 to 15 Sep 2026. The first training window of 100 sessions is never tested out of sample. Source: NSE end of day data (count of sessions), computed by RupeeCase. As of 15 Sep 2026.

Rolling or anchored, and how long a window?

A rolling window drops old data as it moves, so the fit follows recent markets and ignores the distant past. An anchored window keeps the start fixed and grows, so the fit leans on more data and reacts more slowly. Neither is correct in itself. The choice is a guess about whether the market's rules change, and both options should be written down before the run. Window length is the same trade: short windows adapt and fit noise, long windows are steadier and may fit a regime that has gone. A fold also needs enough trades to say anything. A weekly rule trades about 10 times in a test window of 50 sessions, far fewer than the trades a result needs.

Maths: folds, tested sessions and efficiency

Folds = (N − train)
÷ test

Tested = folds × test

Efficiency =
mean test result
÷ mean fit result

Here N is the number of sessions. With N = 300, train = 100 and test = 50, folds = 4, and tested sessions are 200. Efficiency compares what the rule earned on data it had not seen with what it earned on data it was fitted to. A value near one says the fit was not much flattered. A value near zero says it was.

What is leakage, and what is an embargo?

A trade that lasts days carries the end of the training window into the start of the test window: the last training trades are scored on prices from the test window, so the fit has seen part of the test. A feature built from a twenty day average does a milder version of the same, because the first test rows share most of their inputs with the last training rows. The remedy is an embargo, a gap between the two windows in which nothing is traded or scored, at least as long as the holding period and, to be careful, as long as the feature's window. An option position that runs to expiry needs the gap to reach to that expiry. It is also tidier to cut folds at expiries, so no trade is split across the boundary.

The term this section turns on: Embargo

The term this section turns on: EmbargoThe term this section turns on: Embargo. Embargo: A gap between a training and a test window, at least as long as the holding period or the feature window, so no data leaks across the boundary.EmbargoA gap between a training and a test window, atleast as long as the holding period or thefeature window, so no data leaks across...
From the module glossary; every term is in the Learn glossary too. Source: Module 19.7, Walk forward and out of sample testing.

Does it suit options?

It fits, with three extra cares. An option trade ends at an expiry, so a fold should begin and end on expiry dates, and no position may be open across a boundary. The contract changes inside the history: the lot, the expiry day and the charges in the lesson on options backtests all differ between folds, so every fold needs its own table of rules. And volatility regimes are the largest source of difference between windows. A short volatility rule fitted in a calm fold will meet a spike in another. The method does not hide that. It shows it, one fold at a time.

How do I read the result?

Three checks, in this order. First, the stitched test record, judged by the measures in strategy metrics, not by the training fits. Second, the efficiency ratio: a rule whose test results are a small part of its fit results was mostly fitted. Third, and the one I look at before the total, the parameter that wins each fold. If it sits near the same value in every fold, the rule has found something stable. If it jumps from fold to fold, the fit is chasing noise. A rule can show a good stitched record and still fail this third check.

Four test windows come out of the school's 300 sessions

  1. Test 1

    Fit on 1 Jul to 24 Nov 2025, then trade 25 Nov 2025 to 4 Feb 2026.

  2. Test 2

    Fit on 11 Sep 2025 to 4 Feb 2026, then trade 5 Feb to 22 Apr 2026.

  3. Test 3

    Fit on 25 Nov 2025 to 22 Apr 2026, then trade 23 Apr to 6 Jul 2026.

  4. Test 4

    Fit on 5 Feb to 6 Jul 2026, then trade 7 Jul to 15 Sep 2026.

A rolling fit of 100 sessions and a test of 50 sessions, moved forward by 50 sessions each time. Sessions are NSE trading days, so the dates skip weekends and holidays. No embargo gap is cut here, to keep the count simple. Source: NSE end of day data, computed by RupeeCase. As of 15 Sep 2026.
The RupeeCase terminal on sample data: Rebalance cadence: how often does the strategy trade?
Watch in the terminal: how often does the strategy trade? A short tutorial on sample data.

Where does a final holdout go?

Walk forward folds are used to build and tune. Keep a last stretch of history outside all of them, a final holdout, and look at it once, after the rule and its windows are frozen. The folds may be reused as often as the work needs, since they are part of the fit. The holdout may be spent once. If it fails, the honest options are to stop or to start a new rule with a new holdout. Going back to retune against the same holdout makes it a fold.

How do I lay out my own folds?

Take any series of dates, such as the school's files, and lay out your own folds before running anything. Write down five choices: the training length, the test length, the step, the gap and whether the window rolls or anchors. Count the sessions in each fold and the trades you expect in each test window. Work out how many folds you get and what share of the data is tested out of sample. Then ask whether the trades per fold are enough to say anything. If they are not, no choice of windows will fix it, and the answer is a longer history or a rule that trades more often.

Worked example: four folds of a made up rule

The test windows are real and the rule is not. Each window is a different market. The table gives, for each, the move in Nifty over the window and India VIX at its start and end. A rule fitted before a window never saw it.

Test windowNiftyVIX, start to end
1: 25 Nov to 4 Feb−0.7%13.24 to 12.25
2: 5 Feb to 22 Apr−5.4%12.25 to 18.30
3: 23 Apr to 6 Jul0.2%18.30 to 11.82
4: 7 Jul to 15 Sep−5.4%11.82 to 13.43

The four test windows meet four different volatility regimes

India VIX daily close from 1 Jul 2025 to 15 Sep 2026 with the start of each of four test windows marked: window 2 contains a spike and the other windows are calmerIndia VIX: from 12.5 at 1 Jul 2025 to 13.4 at 15 Sep 2026, high 27.9 at 30 Mar 2026, low 9.15 at 26 Dec 2025.1015202530Jul 2025OctJan 2026AprJulTest 1Test 2Test 3Test 413.4
India VIX daily close. The marks show where each test window begins. The rule fitted before a window is tested on the volatility that follows it. Source: NSE end of day data, computed by RupeeCase. As of 15 Sep 2026.
Made up foldFitTestLookback
11.80.910
22.10.140
31.61.115
42.00.260

Each fold scored lower on data it had not seen

Made up Sharpe ratios of four folds: the fit scores average 1.88 and the test scores average 0.58Fold 1 fit 1.8; Fold 1 test 0.9; Fold 2 fit 2.1; Fold 2 test 0.1; Fold 3 fit 1.6; Fold 3 test 1.1; Fold 4 fit 2.0; Fold 4 test 0.2.Made up Sharpe ratio, fit and testFold 1 fit1.8Fold 1 test0.9Fold 2 fit2.1Fold 2 test0.1Fold 3 fit1.6Fold 3 test1.1Fold 4 fit2.0Fold 4 test0.2
Made up numbers, not market data, to show the arithmetic. The fit bar is the score on the training window and the test bar is the score on the window after it. Source: RupeeCase arithmetic, no market data. As of 17 Oct 2026.
Read 3 more paragraphs, 154 words

Window 2 holds the spring of 2026, when VIX climbed from 12.25 to 18.30. Window 3 begins in that stress and ends calm. The same rule faces four temperaments, and a single split would have tested it on one of them.

Now the rule's own numbers, all made up. The fit score of each fold is the rule's Sharpe ratio on its training window. The test score is the Sharpe ratio on the window after it. The last column is the fitted parameter, a lookback in sessions.

The fit scores average 1.88 and the test scores 0.58, so efficiency is 0.31. Every fold paid for being tested, which is the usual shape: a fitted rule looks better than it is. The lookback wandered between 10 and 60 sessions, which is the third check failing. A rule whose best parameter changes sixfold from fold to fold has no single setting worth trusting.

The common mistake

The belief: I used walk forward testing, so the result is out of sample. It is only as out of sample as the discipline behind it. If the rule, the window lengths or the markets changed after a look at the folds, the folds joined the fit and the run is in sample at one remove. Walk forward also reuses one history. It cannot make the data longer, and it cannot add a crash that did not happen. Keep a final holdout, a stretch of data nobody touches until the rule is frozen, and spend it once. A pass there is still a record of the past. SEBI lets only registered advisers, research analysts and empanelled algo providers make performance claims, verified by a PaRRVA. Monte Carlo and bootstrap asks how much of the result could be luck.

Key takeaways

  • A test part is out of sample only until a result changes the rule.
  • Walk forward repeats fit, freeze and test along the calendar.
  • Four folds from the files test two thirds of the data.
  • Cut an embargo gap as long as the holding period or feature window.
  • A best parameter that jumps between folds is a sign of fitting noise.
  • Ten trades a fold cannot carry a verdict by itself.
The RupeeCase terminal on sample data: Model history or your portfolio: which numbers am I looking at?
Watch in the terminal: which numbers am I looking at? A short tutorial on sample data.

Before you trade. Derivatives trading carries a high risk of loss. SEBI's study "Profitability of Individual Traders in the Equity Derivatives Segment (FY25 to FY26)" (August 2026) found that 87.7% of individual traders in equity F&O made net losses in FY26, with aggregate net losses of Rs 91,685 crore. Read the SEBI study