Walk-forward analysis
Evaluate the refitting procedure
Walk-forward also evaluates how and when the model is updated. Each step can use only earlier observations. Training windows can roll or expand; length, parameter range and update schedule should be specified before evaluation. In the example, an earlier test period can enter a later training window because it is then historical data. Knowledge gained that way cannot be applied retrospectively to an earlier test.
Combine results correctly
Join actual test segments only, with costs and sizing appropriate to each step. Do not add training performance to the validation curve. Overlapping tests can count a trade repeatedly; define attribution rules. Summed R or a per-trade mean is not automatically a compounded account return. Window boundaries must also specify how existing open positions are treated.
Limitations
Choosing the best window length after reviewing results is another fitting step. Few windows, small samples and dependent trades limit conclusions. Data processing fitted on the entire history can leak information despite correctly split dates. scikit-learn’s TimeSeriesSplit illustrates chronological splitting; the function does not itself resolve financial execution rules.
The cost of changing models
Refitting can change positions, order count or trading frequency. If switching variants requires closing and reopening, include those fills and charges in the evaluated procedure. Do not automatically erase an open loss at a window boundary or charge the same cost twice. Record account state between steps so the joined curve represents an achievable process rather than independent restarts with fresh capital.
Application
Keep each step’s parameters and results, observation counts, costs and failures. Compare stability against a frozen strategy without frequent tuning. Once the full procedure has been selected, conduct a further independent assessment rather than infer a promise from a few positive windows. In the course: strategy testing. Source checked on 11 October 2026.
Diagram and worked example
Open the full-size graphic