Research by conversation
Ask the agent to investigate markets, companies, filings, strategies, and your connected account context.
Trading strategy validation guide
Define a sequence of historical training and test windows, fit or select strategy rules using only each training window, and evaluate the unchanged result on the period that follows. Walk-forward evidence can expose instability, but it cannot prove future performance.
Ask the agent to investigate markets, companies, filings, strategies, and your connected account context.
When direct trading is enabled, request a one-time trade in plain English, inspect the order, and approve it before submission.
Create, revise, backtest, connect, and operate Lumibot strategies without assembling the full application stack yourself.
Work in BotSpot or connect through ChatGPT, Claude, Cursor, Codex, and other compatible MCP clients.
Walk-forward testing evaluates a strategy through multiple time-ordered folds. Each fold uses an earlier period for development and the next period for evaluation. The process then advances through history without training on future observations.
Walk-forward testing and walk-forward optimization are related but not identical. Testing can evaluate fixed rules across sequential periods. Optimization adds parameter or model selection inside each training window before applying the selected version to the following test window.
Choose the training length, test length, step size, optional gap, parameter search space, selection objective, execution model, and stopping rule before comparing outcomes. Changing the protocol after seeing weak folds turns the evaluation process into another optimization.
Test-window length should reflect the intended live decision and retraining schedule. A model intended to update monthly should not claim deployment realism from a schedule that reselects parameters every day.
An anchored, or expanding, window keeps the original start date and adds newly available history at each step. It provides more training observations over time, but old regimes continue influencing every later fit.
A rolling, or sliding, window moves both boundaries forward and keeps a fixed lookback length. It emphasizes recent history and discards older observations, but gives each fit less data.
Neither design is universally better. Choose one based on how the deployed strategy would learn and how quickly its inputs may become stale, then keep that choice fixed during evaluation.
Fit normalization, feature selection, imputation, model parameters, thresholds, and universe rules using the training window only. Apply the fitted process to the next test window without learning from that window first.
Add a gap between training and testing when labels, delayed publications, holding periods, or feature calculations overlap the boundary. A gap cannot repair incorrectly timestamped or revised data; inputs still need point-in-time availability.
Earlier test observations may become training data in later folds because they would be known by that later date. They must not influence the earlier fold.
When parameters change between folds, record which training observations, candidate values, objective, and tie-breaking rule selected each version. The version chosen from one training window must remain unchanged throughout its next test window.
Frequent optimization can react to newer data, but it also increases compute, turnover, and opportunities to fit noise. QuantConnect documents this tradeoff between recent fitting and overfitting risk.
A production implementation must reproduce historical retraining timing, data availability, warm-up, and state transitions. A walk-forward backtest that updates at impossible times does not represent a deployable process.
Join non-overlapping test periods in chronological order to inspect the simulated experience produced by the complete update policy. Also report each fold separately so one exceptional interval cannot hide instability.
Compare results with a relevant benchmark over the same dates and under compatible exposure and cost assumptions. Review drawdown, turnover, concentration, trade count, parameter changes, and execution sensitivity alongside returns.
Walk-forward testing reduces some weaknesses of one historical split, but it does not eliminate selection bias. Trying many strategies, window designs, objectives, or preprocessing choices can overfit the complete research process.
Short windows can produce noisy estimates. Long windows can mix incompatible regimes. Historical folds still depend on data quality and assumptions about fills, fees, slippage, liquidity, latency, partial fills, and market impact.
Future market structure can differ from every historical window. Walk-forward results remain simulated and do not guarantee profitability, safe deployment, or live execution quality.
No. Walk-forward testing describes sequential, time-ordered evaluation. Walk-forward optimization additionally selects parameters or logic inside each training window before testing the selected version on the next period.
Use the design that matches the intended live learning policy. Anchored windows retain all earlier history; rolling windows keep a fixed recent lookback. Choose before reviewing results and document the tradeoff.
No fixed number proves validity. Use enough chronological folds to evaluate repeated behavior while keeping each training and test window meaningful for the strategy frequency, sample size, and intended update schedule.
No. Results remain historical simulations. Paper testing, broker validation, monitoring, exposure controls, and separate live-deployment review remain necessary.
Sources verified 2026-08-14.
Past performance does not guarantee future results. Automated trading involves risk of loss.