NQ.REPLAY

Guide · Backtesting method

Walk-forward testing with chronological, untouched test folds

Walk-forward testing splits history into consecutive blocks: you choose or tune rules on one block, then trade them unchanged on the next block you have not looked at. Only those later blocks count as evidence.

Short answer

Order sessions by date, pick rules on a training window, freeze them, then test on the next, unseen window. Roll both forward and repeat. Judge the strategy only on the joined test windows. Example: 12 months with 3-month training and 1-month tests gives 9 out-of-sample months.

Designing the folds

Rolling walk-forward schedule over twelve months
FoldTraining (choose rules)Test (untouched)
1Months 1–3Month 4
2Months 2–4Month 5
3Months 3–5Month 6
………
9Months 9–11Month 12
Rolling windows drop the oldest month each step. An anchored variant keeps month 1 and grows the training window instead.

Protocol for manual replay testing

  1. Write every rule before fold 1: market, session times, entry, stop, target, maximum trades per day, cost and slippage assumptions.
  2. List the test dates of every fold in advance and do not open them during training — not even to “check the chart”.
  3. On the training window, choose among a small number of pre-declared variants (for example a 15- or 30-minute opening range). More variants raise the chance of picking a lucky one.
  4. Freeze the chosen variant, then trade the test window bar by bar in replay, logging every trade in R.
  5. Roll forward and repeat. Never edit a finished test fold's log.
  6. Join all test-fold trades and compute expectancy and profit factor on that combined record only.

Worked example (hypothetical)

Hypothetical walk-forward results
FoldVariant chosen in trainingTraining avgTest tradesTest avg
115-min range+0.31R14+0.12R
230-min range+0.27R11−0.18R
315-min range+0.22R16+0.05R
Invented numbers to illustrate the arithmetic, not results from our archive. Combined test record: (14 × 0.12 − 11 × 0.18 + 16 × 0.05) ÷ 41 = +0.012R per trade — far below the training averages, which is the typical warning sign walk-forward is designed to expose.

Common leaks

  • Remembering a famous day you have seen before. Prefer dates you have not studied, or note the contamination.
  • Using an end-of-day level (such as the day's high) inside a rule that fires earlier that day — lookahead.
  • Changing the cost or fill assumption between training and test.
  • Reporting the best fold instead of all folds.

Frequently asked questions

Why not just shuffle sessions randomly?

Markets change over time. Random splits let information from later periods leak into training, which a trader could never have had. Chronological folds respect the order in which you would really have learned.

Can I adjust the rules after a bad test fold?

Only for the next fold, using the next training window. The fold you just saw is now spent; re-testing on it is no longer out-of-sample.

Who formalised walk-forward analysis?

Robert Pardo is commonly credited with popularising walk-forward analysis for trading systems; this guide adapts the idea for manual, bar-by-bar replay.

References

  1. CFTC — Learn and protect: customer advisories
  2. Robert Pardo, The Evaluation and Optimization of Trading Strategies, 2nd ed. (Wiley, 2008)

Run a fold in replay

NQ replay hides future bars until you advance, which suits manual walk-forward testing. Pick a training month, freeze your rules, then trade the next month's sessions.

Educational content only. Nothing here is investment, tax or trading advice. Examples are hypothetical and simulated or historical results do not predict future results. Futures involve substantial risk of loss. See the risk disclosure.