AI Fin Hub

Playground

Walk-Forward Validation Visualizer

Over 4 rolling windows the mean in-sample Sharpe is −1.15 and the mean out-of-sample Sharpe 0.94.

On the documented defaults, computed by this tool's engine · the same answer as JSON

Paste a strategy returns CSV; see in-sample vs out-of-sample Sharpe per window plus the IS→OOS drop. Browser-only deterministic math.

01Playground

Runs in your browser. Nothing you enter is uploaded, and no account or API key is needed.

Education, not investment advice. Past performance does not predict future results. How we check our numbers.

Inputs

Daily strategy returns as decimals (0.012 = 1.2%). The benchmark column is optional and not used in the Sharpe split.

Number of test windows

The series is cut into one training block followed by this many back-to-back test blocks.

Training share of each window

120 training days, 48 test days per window (of 504).

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

3.50-1.912345678

Light bars: in-sample Sharpe. Dark bars: the following out-of-sample block.

Per-window Sharpe

#IS spanOOS spanIS SharpeOOS SharpeΔ
112048-0.971.36+2.33
2120480.713.46+2.75
3120481.68-1.61−3.29
4120482.400.09−2.31
5120480.371.89+1.52
6120480.16-1.87−2.03
7120481.031.96+0.92
812048-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.

02Receipt

What the answer above ran on, how it is computed, where the data comes from, and a link that reopens it.

Inputs

  • moderolling
  • num_windows4
  • rows252 values
  • train_pct0.7

The documented defaults. Change any input above and the tool recomputes.

Method

How the hub's tools are built and checked

Engine /engines/walk-forward-validation-visualizer.js, sha256 46499fdb2fba. The page, the API and MCP run the same file.

Source

Your inputs / BYO key

Page updated .

Permalink

aifinhub.io/walk-forward-validation-visualizer/

The link carries the inputs you set, so it reopens this result.

03For agents

Any agent can run this calculator by URL or MCP and get the same answer as JSON: the inputs that used defaults, the result and a line to cite. The call below follows the inputs you set above. In code, import the same engine; it runs where you import it, with no request or key.

Requestthe documented defaults
GET https://aifinhub.io/api/run/walk-forward-validation-visualizer
Response200 application/json · 28.9 KB
{
  "calculator": "walk-forward-validation-visualizer",
  "title": "Walk-Forward Validation Visualizer",
  "site": "AI Fin Hub",
  "input": {},
  "defaults_used": {
    "mode": "rolling",
    "num_windows": 4,
    "rows": [
      {
        "strategy": 0.008538,
        "benchmark": 0.010128,
        "date": "2024-01-02"
      },
      {
        "strategy": -0.009035,
        "benchmark": -0.002693,
        "date": "2024-01-03"
      },
      {
        "strategy": -0.00485,
        "benchmark": -0.005739,
        "date": "2024-01-04"
      },
      "… 249 more of 252"
    ],
    "train_pct": 0.7
  },
  "result": {
    "windows": [
      {
        "index": 0,
        "isStart": 0,
        "isEnd": 96,
        "oosStart": 96,
        "oosEnd": 135,
        "isSharpe": -1.4226050927611509,
        "oosSharpe": -2.448794498040381,
        "isReturn": -0.100173,
        "oosReturn": -0.070375
      },
      {
        "index": 1,
        "isStart": 39,
        "isEnd": 135,
        "oosStart": 135,
        "oosEnd": 174,
        "isSharpe": -2.818738905562593,
        "oosSharpe": -0.14070048975729785,
        "isReturn": -0.196556,
        "oosReturn": -0.003405
      },
      {
        "index": 2,
        "isStart": 78,
        "isEnd": 174,
        "oosStart": 174,
        "oosEnd": 213,
        "isSharpe": -1.1154399144323688,
        "oosSharpe": 3.48775893245795,
        "isReturn": -0.073087,
        "oosReturn": 0.096621
      },
      {
        "index": 3,
        "isStart": 117,
        "isEnd": 213,
        "oosStart": 213,
        "oosEnd": 252,
        "isSharpe": 0.7370603241059304,
        "oosSharpe": 2.8463838163014565,
        "isReturn": 0.05015,
        "oosReturn": 0.087331
      }
    ],
    "meanIsSharpe": -1.1549308971625456,
    "meanOosSharpe": 0.936161940240432,
    "dropPct": -1.8105783147203103,
    "totalIsObs": 384,
    "totalOosObs": 156
  },
  "provenance": {
    "run": "https://aifinhub.io/api/run/walk-forward-validation-visualizer",
    "page": "https://aifinhub.io/walk-forward-validation-visualizer/",
    "methodology": "https://aifinhub.io/walk-forward-validation-visualizer/",
    "contract": "https://aifinhub.io/contracts/walk-forward-validation-visualizer.json",
    "engine": "https://aifinhub.io/engines/walk-forward-validation-visualizer.js",
    "engine_sha256": "46499fdb2fba98e1d475f57508f0a3bb6cfaf508cc067f4f2bff20f9d70c2d8c",
    "build": "d4d071dba6f1f7db23f33f8f0df24024b2a95f80"
  },
  "disclaimer": "Planning estimates only — not financial, tax, or investment advice.",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "cite": "AI Fin Hub, Walk-Forward Validation Visualizer (engine 46499fdb2fba), https://aifinhub.io/api/run/walk-forward-validation-visualizer"
}
The response for the defaults, with long lists and text shortened here; the run URL returns all of it.

How to use it

  1. Paste daily strategy returns (date, strategy, optional benchmark). A decaying-edge demo loads by default.
  2. 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.
  3. Choose rolling (fixed-length training window) or anchored (training always starts at the first day).
  4. Read the drop from mean in-sample Sharpe to mean out-of-sample Sharpe and the bar chart of both for every window.
  5. 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.

  • 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 decay that PBO alone misses.

  • 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), and the multiple-testing haircut.

  • Calculators Backtest Overfitting Score

    Upload a returns CSV (one column per strategy you tried) or simulate a strategy search: the probability of backtest overfitting (PBO) by CSCV and the Deflated Sharpe Ratio.

  • 11 min read Walk-Forward Window Sizing: A Decision Rule

    On the canonical 50-bar tape the engine returns mean OOS Sharpe 0.653, efficiency 0.600 — but the four windows hide a regime flip the half-life rule fixes.

All articles