Rolling crypto backtest windows retain a fixed amount of recent training history and drop older observations as time advances. Expanding windows retain the original start and add newly available observations. Neither is universally better: the choice changes the model's memory, the amount of evidence used at each fit and which past conditions remain represented. Compare them on the same later evaluation dates with the rest of the procedure held fixed.
The origin moves in both designs
A training window specifies which past observations may influence a fit. An evaluation window specifies where that frozen fit is assessed. Moving the evaluation start forward does not tell you whether training history expands or rolls; both designs can sit inside a walk-forward procedure.
The terminology can be confusing because “rolling origin” describes an advancing forecast origin, including schemes with growing training history. The forecasting textbook's time-series cross-validation chapter uses that term for a past-only chronological evaluation. Here, “rolling window” means a fixed-length training sample whose oldest observations leave.
For model freezes, label availability and continuous portfolio accounting, use the existing crypto walk-forward testing protocol. This article isolates one decision within that protocol: how much training memory survives the next fit.
A ledger of what each fit remembers
Consider ten ordered observations. Every observation is a completed daily target available before the relevant fit; there are no missing rows or publication delays in this hypothetical exercise. Begin with four training observations, refit after every two additional observations and evaluate the next two. Use a four-observation rolling window or an expanding window anchored at observation 1.
The invented targets are +8 basis points for observations 1–4 and −2 basis points for observations 5–8. A basis point is 0.01 percentage points. Fit only their arithmetic mean, without claiming that it is a useful trading forecast.
| Fit | Rolling training rows | Expanding training rows | Shared evaluation rows | Rolling fitted mean | Expanding fitted mean |
|---|---|---|---|---|---|
| A | 1–4 | 1–4 | 5–6 | +8 bp | +8 bp |
| B | 3–6 | 1–6 | 7–8 | +3 bp | +4.67 bp |
| C | 5–8 | 1–8 | 9–10 | −2 bp | +3 bp |
At fit B, the rolling sum is 8 + 8 − 2 − 2 = 12 bp, divided by four observations. The expanding sum is 4 × 8 − 2 × 2 = 28 bp, divided by six. At fit C, expanding retains the four earlier positive observations: (32 − 8) / 8 = 3 bp. Rolling has dropped all four.
The disagreement at C comes entirely from retained history. Nothing about evaluation rows 9–10 has been used, and their outcomes are deliberately unspecified. A more responsive estimate can be wrong if the recent negative observations are temporary noise. A slower estimate can be wrong if the earlier positive conditions have ended.
This example also exposes a boundary effect. Replacing one +8 bp observation with one −2 bp observation changes a four-row rolling mean by (−2 − 8) / 4 = −2.5 bp. An old observation's departure can move the estimate substantially even when the newest observation resembles the previous one. Inspect departures alongside arrivals when explaining a changed signal.
Short memory trades relevance for lost evidence
A rolling sample limits how long an observation remains directly eligible for fitting. That can be a reasonable research hypothesis when relationships change. It also removes evidence of events that did not recur recently: a liquidity shock, a funding extreme or a prolonged one-directional market.
An expanding sample retains those older observations, but their relevance is an assumption. More rows do not necessarily mean more useful evidence for today's relationship. With equal weighting, a recently changed pattern initially competes with every retained older observation. Different model structures or weighting rules can change that behavior, so window labels alone do not determine responsiveness.
The Skforecast 0.18 backtesting documentation separately describes refitting with fixed and increasing training sizes, as well as intermittent refits. These are separate configuration choices. A short window refitted monthly can still retain an unchanged model for most of that month.
Write the hypothesis before looking for a winner. “Discard information older than 180 days because the intended relationship is recent” is testable. “Use whichever window gives the best curve” hides another selection process. Preserve alternative lengths and anchors in the backtest trial ledger.
Count time, rows and usable targets separately
A fixed number of observations is not automatically a fixed duration. A 180-row daily series with missing dates can span more than 180 calendar days. A 180-row trade series can span very different durations as trading activity changes.
Scikit-learn's TimeSeriesSplit reference documents a maximum training size and an optional gap, and notes equal spacing when comparing fold durations. Those controls operate on samples; they do not validate a crypto dataset's calendar or decide which labels were available.
Record both the intended interval and the actual first and last eligible timestamps. Count raw rows, accepted observations and usable completed targets. If a new instrument has only 80 eligible days, a 180-day window cannot manufacture the missing 100. Predeclare whether to delay evaluation, omit that instrument or use a separately identified shorter-history procedure. Check the inputs with the backtest data-quality worksheet.
Dropping rows may leave hidden memory
A strict rolling fit should identify every learned component that receives training observations. A scaler fitted on the full archive still carries older and potentially future information even if the final model sees only the declared rolling rows. The scikit-learn leakage guidance explains why preprocessing must learn from the training subset. A model updated from previous weights can also retain earlier training influence. Recreating a fresh fit and continuing an existing model are different experiments.
Feature history is a separate question. A moving average may legitimately require earlier known prices to initialize features near the training start. That does not automatically make those prices extra fitted target rows. Save the feature warmup rule, any recursive state and the fitted preprocessing scope so that “four training observations” has an unambiguous meaning. The look-ahead bias audit covers whether each input was knowable at its decision time.
A paired comparison worksheet
Use identical evaluation timestamps, instrument eligibility, costs and execution assumptions. Change only the training-memory policy for the initial comparison. Record these fields for each pair:
| Field | Required entry |
|---|---|
| Memory rule | Rolling duration or row count; expanding anchor date |
| Fit schedule | Initial minimum sample and exact refit times |
| Departures | Oldest retained observation and newly dropped rows |
| Effective sample | Eligible target count after availability and quality exclusions |
| Hidden state | Preprocessing fit scope, warmup data, fresh fit or continuation |
| Comparison output | Paired forecast errors and, if modeled, the same defined trading metrics |
A favorable average difference should also be examined across dates. Adjacent fits share training data, and overlapping targets can create dependent errors. The bootstrap confidence-interval guide explains why uncertainty estimation needs assumptions about that dependence; a longer expanding sample does not itself supply an uncertainty guarantee.
If the evaluation models deposits or withdrawals, distinguish the strategy's return from the investor's cash-flow experience using time-weighted versus money-weighted returns. Window memory and return accounting answer different questions, and both must be consistent before interpreting a comparison.
Method and limits
This AI-assisted educational article uses primary forecasting and software documentation plus an original synthetic observation ledger. Its arithmetic describes fitted means, not market performance. No crypto model was fitted, no window length was established as optimal and no KLINEO window-selection feature is asserted. For a particular published test, inspect its backtest methodology and the exact saved configuration before transferring conclusions.
