Walk-forward testing: what it is and how QuantGPT runs it
Updated November 2, 2026
Walk-forward testing builds a strategy's rules on an earlier stretch of history, then replays them untouched on a later stretch they never saw. QuantGPT splits each stock backtest chronologically at a cut year (2015 unless you pick another) and reports the years from the cut on their own, beside the whole run.
- How tools compare
- How QuantGPT runs it
- The three findings
- The decay check in challenge_finding
- Questions
How tools compare
| Tool | Walk-forward support | Split method | Where to read more |
|---|---|---|---|
| QuantGPT | Built in. Every stock backtest reports the years before and from the cut year separately, and challenge_finding checks the later years for decay | One chronological cut on January 1 of the split year, 2015 unless you pick another. The same rules run through both windows; nothing is re-fitted at the cut. Random splits are not offered | The findings system and the sections below |
| QuantConnect | Yes, written into your algorithm. Its docs describe walk-forward optimization as periodically adjusting a strategy's logic or parameters to optimize an objective over a trailing window | Rolling: you set the re-optimization schedule with DateRules and TimeRules passed to its Train method. The docs' example re-optimizes at the start of each month on the trailing 365 days | QuantConnect: Walk Forward Optimization |
| TradingView | Not stated. Its Pine Script strategies page and its Deep Backtesting page describe no walk-forward or out-of-sample test | Not stated. You choose the date range a strategy is tested on | Pine Script strategies, How Deep Backtesting works |
| Backtrex | Yes, per its walk-forward guide (a blog post of October 29, 2026); its documentation index lists no walk-forward page | In-sample and out-of-sample windows cut by a ratio you define, parameters optimized on each in-sample window and applied to the next out-of-sample window. The guide explains rolling and anchored windows; which Backtrex runs is not stated | Backtrex: Walk Forward Analysis guide, Backtrex docs |
How QuantGPT runs it
- Chronological only. The cut is a date, January 1 of the split year: every period before it is in-sample, every period from it is out-of-sample. Random or interleaved splits are not offered, because neighbouring periods in a market series share information: a shuffled hold-out leaks later years into earlier ones and flatters the result.
- The same rules, replayed. Your criteria run unchanged from the first period to the last. The engine then measures the strategy and its benchmark (growth a year, Sharpe ratio, worst fall) on the years before the cut and on the years from it, and shows both beside the whole run. Nothing is re-fitted at the cut.
- Your cut year.
split_yearis 2015 unless you set it; years outside 1950 to 2100 are moved to the nearest end, and the result says so. A weekly or daily rebalance that moves the start later also keeps the cut at least four years after the start. The single-stock daily test,run_daily_backtest, cuts at 2024 or two years after its start, whichever is later, unless you pick a year. - Companies that later delisted. They are only partly in the market-wide backtest universe from 1998: on 2026-11-02, 12,521 of the 12,841 delisted operating companies with prices from 1998 (98%) could enter it, and each market-wide result states the share it measured (
dead_coverage). Before 1998 the universe holds survivors only, so a market-wide backtest leans toward survivors. A backtest on a list of tickers is not affected.
The three findings
Every stock backtest ends in one of three findings. Each describes what the data did over the window; none is a prediction or a recommendation.
- DATA VALIDATED: over the whole window the criteria beat the benchmark on both growth (CAGR) and Sharpe, and after the split they did not fall behind it on both.
- TRADE-OFF: they beat the benchmark on one of growth or Sharpe and not the other, or on both over the whole window but behind it on both after the split.
- NO EDGE: they beat the benchmark on neither.
More on reading them: the findings system.
The decay check in challenge_finding
challenge_finding runs eleven checks that try to break a finding. Seven read the run: sample size, walk-forward decay, the probabilistic Sharpe ratio, random books, costs, decades and a thousand resampled histories. Four re-run it with one thing changed: the total-return index, twice the book, five fewer years and operating companies only. It ends HOLDS (no fails, at most one flag), FRAGILE (two or more flags) or DOES NOT HOLD (any fail), with the strongest objection first.
The walk-forward check compares the years from the cut with the benchmark over the same years, and with the strategy's own Sharpe before the cut:
- PASS: at or ahead of the benchmark on Sharpe or on growth after the cut, and the out-of-sample Sharpe is at least half the in-sample Sharpe.
- FLAG: at or ahead of the benchmark, but the out-of-sample Sharpe is below half the in-sample Sharpe (counted only when the in-sample Sharpe is above zero). Also a flag when the cut leaves no years after it.
- FAIL: behind the benchmark on both Sharpe and growth after the cut.
Questions
What is walk-forward testing?
Walk-forward testing checks a trading strategy on data it was not built on. The rules are set on an earlier stretch of history, then run unchanged on a later stretch, and the later stretch is scored on its own. A rolling version repeats this in steps, re-fitting on each new earlier window. QuantGPT uses one chronological cut, 2015 unless you pick another year.
How is it different from a single backtest?
A single backtest reports one set of numbers for the whole window, so the years the rules were shaped on and the years they were not are mixed together. A walk-forward test scores the later years separately. On QuantGPT both come back in one result: the whole window, the years before the cut and the years from it, for the strategy and its benchmark.
What does the held-out window show?
How the same rules did on years they were not shaped on, against the benchmark over those same years. On QuantGPT, a strategy that beat the benchmark on growth and Sharpe over the whole window but fell behind on both after the cut reads TRADE-OFF, not DATA VALIDATED, and challenge_finding flags an out-of-sample Sharpe below half the in-sample one. It is history, not a forecast.
Related
- LearnBacktest a trading strategy without coding
- ComputeMCP server for backtesting
- DataThe research warehouse
- Strategy libraryThe Strategy Library
Research, not advice. Past results, gross of costs unless stated. The disclosures and terms govern.