Playground
Walk-Forward Validation Visualizer
Paste a strategy returns CSV; see in-sample vs out-of-sample Sharpe per window plus the IS→OOS drop. Browser-only deterministic math.
Runs in your browser. Nothing you enter is uploaded, and no account or API key is needed.
Inputs
Daily strategy returns as decimals (0.012 = 1.2%). The benchmark column is optional and not used in the Sharpe split.
The series is cut into one training block followed by this many back-to-back test blocks.
Window mode
OOS Sharpe drop vs IS
3%
IS Sharpe 0.66. OOS Sharpe 0.64, 8 windows (rolling).
In-sample vs out-of-sample Sharpe by window
Light bars: in-sample Sharpe. Dark bars: the following out-of-sample block.
Per-window Sharpe
| # | IS span | OOS span | IS Sharpe | OOS Sharpe | Δ |
|---|---|---|---|---|---|
| 1 | 120 | 48 | -0.97 | 1.36 | +2.33 |
| 2 | 120 | 48 | 0.71 | 3.46 | +2.75 |
| 3 | 120 | 48 | 1.68 | -1.61 | −3.29 |
| 4 | 120 | 48 | 2.40 | 0.09 | −2.31 |
| 5 | 120 | 48 | 0.37 | 1.89 | +1.52 |
| 6 | 120 | 48 | 0.16 | -1.87 | −2.03 |
| 7 | 120 | 48 | 1.03 | 1.96 | +0.92 |
| 8 | 120 | 48 | -0.13 | -0.18 | −0.05 |
Reading the result
A drop >50% is a red flag — the strategy looks overfit to the in-sample window. 20–50% is typical for honest strategies once costs are added. <20% is rare and worth verifying.
How to use it
- Paste daily strategy returns (date, strategy, optional benchmark). A decaying-edge demo loads by default.
- Set the number of test windows and the training share of each window. The series is cut into one training block followed by that many back-to-back test blocks.
- Choose rolling (fixed-length training window) or anchored (training always starts at the first day).
- Read the drop from mean in-sample Sharpe to mean out-of-sample Sharpe and the bar chart of both for every window.
- Use the per-window table to see which periods fail. A drop above 50% is a red flag for overfitting.
Questions people ask
What's walk-forward validation?
Iterative out-of-sample validation: optimize on the first N years, test on years N+1 to N+2, then slide the window forward. Repeat. Each test window is genuinely out-of-sample with respect to the optimization. This is much more robust than a single train/test split.
How is window length chosen?
You choose the number of test windows and the training share of each window; the tool sizes the blocks so one training block plus the test blocks cover the whole series. A training span several times the test span (for example 70% training) is common. Shorter test blocks give more windows but noisier Sharpes; longer ones let drift accumulate.
What's the visualization showing?
Paired bars for the in-sample and out-of-sample Sharpe of every window, and a table with each window's spans, Sharpes and the drop between them. The tool works from returns only; it does not see or optimize strategy parameters, so it shows performance decay, not parameter drift.
Should I aggregate the test windows for a single Sharpe?
Yes, and report it next to the in-sample number. This tool shows the mean out-of-sample Sharpe across windows; the Walk-Forward Validator also reports the Sharpe of all out-of-sample days pooled. The in-sample Sharpe is biased upward wherever parameters were fitted on it.
How does this compare to k-fold cross-validation?
K-fold is fine for static prediction problems but wrong for time series, because folds shuffle past and future. Walk-forward respects time order. Time-series CV (rolling-origin CV) is mathematically equivalent to walk-forward. The tool implements it.
Guides, formulas and worked examples
- Guide How to Run Walk-Forward Validation
- Comparison Walk-Forward vs K-Fold Cross-Validation
- Checklist Walk-Forward Validation Setup Checklist
- Checklist Overfitting Red-Flags Checklist
Related tools
- Playgrounds Walk-Forward Validator
Upload a returns CSV. Rolling or expanding IS/OOS windows, per-window Sharpe, walk-forward efficiency, and a concatenated OOS equity curve. Catches regime.
- Calculators Deflated Sharpe Ratio Calculator
Bailey & López de Prado deflated Sharpe — corrects observed Sharpe for selection bias across K trials. Reports deflated Sharpe, PSR (probability of skill).
- Calculators Backtest Overfitting Score
Upload a backtest trade log and compute Probability of Backtest Overfitting (PBO), Deflated Sharpe Ratio, and the odds your edge survives live trading.
Articles
- 12 min read Did You Overfit? PBO and Deflated Sharpe
A practical tutorial on the two best-documented tests for backtest overfitting — PBO via CSCV and the Deflated Sharpe Ratio. Runnable Python + tool.
- 9 min read How to Read a Backtest Report: 2026 Cheat Sheet
Five questions a backtest report must answer — edge real, persistent, cheap to trade, bearable, explainable — with the statistics that verify each.
- 11 min read Walk-Forward Validation: A Cookbook
Walk-forward is the cheapest honest backtest you can run. Anchored vs rolling windows, the four parameters that matter, and a 60-line Python template.
Use it from code
The same calculation as a JavaScript module you can import. It runs where you import it, with no request, key or rate limit.
import { compute } from "https://aifinhub.io/engines/walk-forward-validation-visualizer.js";