Operations > Strategy Analyzer >

Walk Forward Optimize a Strategy

Print this Topic Previous pageReturn to chapter overviewNext page



Walk Forward optimization is the process by which you optimize strategy input parameters on a historical segment of market data, then test the strategy forward in time on data following the optimization segment using the optimized input values. The central idea is that you evaluate strategy performance data on the test data, not the data used in the optimization. This process is then repeated by moving the optimization and test segments forward in time. To run a walk forward optimization you will need:


Access to historical data
Custom NinjaScript *strategy
A thorough understanding of the Strategy Analyzer's backtesting and optimization capabilities


*There are several pre-defined sample strategies that are installed with NinjaTrader that you can explore.


tog_minusHow to run a Walk Forward Optimization

Start a Walk Forward Optimization

To start a Walk Forward optimization:




1.Left mouse click on an instrument or instrument list and right mouse click to bring up the right mouse click menu. Select the menu item Walk Forward... Alternatively left mouse click on the "w" icon in the Strategy Analyzer toolbar. The default Hot Key CTRL + W can also be used.
2.Select a strategy from the Strategy slide out menu
3.Set the Walk Forward properties (See the "Understanding Walk Forward properties" section below for property definitions) and press the OK button.


The Walk Forward progress will be shown in the Status Bar of the Control Center.

tog_minusUnderstanding the Walk Forward properties

Walk Forward Properties

Apart from the walk forward optimization specific properties described below, the properties are identical to the ones found in the Optimization properties window. Please see the "Understanding optimization properties" section of the Optimize a Strategy page of the Help Guide for more information.




1. Optimization period (days) - Sets the number of days used for the "in sample" optimization data set

2. Test period (days) - Sets the number of days used for the "out of sample" real backtest using the optimized input values generated from the "in sample" period