Choose in-sample days
NinjaTrader compares parameter values inside the optimization window.

Each numbered block is ten days. Amber shows the optimization window and teal shows the subsequent test window.
| Optimize days | Test days | Fast / Slow | Trades | Net |
|---|---|---|---|---|
| 1–30 | 31–40 | 12 / 28 | 12 | $180 |
| 11–40 | 41–50 | 14 / 24 | 11 | -$220 |
| 21–50 | 51–60 | 10 / 32 | 7 | $90 |
| All test windows | 30 | $50 | ||
NinjaTrader compares parameter values inside the optimization window.
Each forward test uses the combination from its preceding optimization window.
Keep the losing period and flag the low-trade period when you review the total.
Open New → Strategy Analyzer from Control Center. Select Walk Forward Optimization as the Backtest type and choose a strategy with optimizable inputs. Use a sample strategy to learn the report. Confirm the dated instrument, series, Trading Hours template, and availability of historical data before you start.
For a small practice grid, use a strategy with Fast and Slow inputs, such as Sample MA Crossover. Set Fast to Min 10, Max 14 and Increment 2. Set Slow to Min 24, Max 32 and Increment 4. That is three Fast values times three Slow values, or nine combinations with the Default optimizer across each complete optimization window. Set Optimize on to Max. net profit for the exercise.
Set Optimization period (days) to 30, Test period (days) to 10, and Keep best # results to three. Enter a Start and End date spanning enough history for several windows. Set your commission, slippage and fill assumptions before running. Check the actual Start date and End date shown in each result, especially if the sample includes weekends, holidays or missing history.
In the first fictional pass, days 1–30 choose 12 / 28. Those values are fixed for days 31–40, which show 12 trades and $180 net. In the second pass, the optimizer uses days 11–40. Days 31–40 can now be training history for the next decision. The next test runs on days 41–50 with its own frozen 14 / 24 values.
The test windows themselves are distinct. The middle window loses $220 and the last makes $90, giving $50 net across 30 trades after modeled costs. If your review requires ten trades per window, flag the last window with seven. Keep its count and result in the record. A small positive aggregate and a short sample leave performance uncertain.
In the Optimization Results Grid, compare each test row’s dates, inputs and figures. Right-click a walk-forward result and select View Optimization Results to see the retained in-sample candidates for that pass. Use those records to inspect nearby settings. NinjaTrader notes that optimization can omit historical Trade objects by default. Check IncludeTradeHistoryInBacktest if your strategy reads past trades, and confirm what evidence was saved before analyzing the output.
Write down the parameter ranges, fitness, window lengths and costs before running the comparison. Walk-forward lets you test a process that reselects parameters at set intervals. If you tune the grid or window lengths after looking at the forward results, keep a later date range untouched for a separate check.
Compare the next unseen test with a fixed-parameter baseline over the same dates and assumptions. Record net P&L, trade count and maximum drawdown, and inspect losing windows and missing data. To calculate drawdown across all test windows, use the ordered equity or trade series. The individual window drawdowns alone leave the cross-window peak and trough unknown.
Platform details on this page were checked against these official resources.
Optimization compares inputs on the selected historical segment. Walk Forward Optimization repeats that selection and tests the chosen values on the following segment.
The optimization period is the historical window used to select inputs. The test period is the next window used to evaluate those inputs before advancing.
Yes. In a rolling walk-forward process, an earlier window can be historical data by the next selection time. Check that the test for each pass comes after that pass’s selection window.
Futures trading contains substantial risk and is not suitable for every investor. TradeReign is a trading-discipline and rule-enforcement application. It does not provide trading advice, trade signals, investment recommendations, or performance guarantees.
TradeReign is not a broker-dealer, futures commission merchant, or investment advisor.
Futures trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Only risk capital - money that can be lost without jeopardizing financial security or lifestyle - should be used for trading. Past performance is not necessarily indicative of future results.