TradeStation Walk-Forward Optimizer

About the TradeStation® Walk-Forward Optimizer®

The TradeStation® Walk-Forward Optimizer® (WFO) is an advanced strategy optimization tool that automates the complex, multi-step task of carrying out the statistical walk-forward testing of a trading strategy's optimized inputs.  

Starting where other optimizing methods typically end, the TradeStation Walk-Forward Optimizer performs a set of 'walk-forward' performance tests using the optimized (in-sample) performance data against the un-optimized (out-of-sample) portion of the data, in order to simulate the unpredictability of trading a strategy in real market conditions.  

The TradeStation Walk-Forward Optimizer is the ultimate strategy trading stress testing tool combining the power of TradeStation's strategy backtesting engine, EasyLanguage, and advanced backtesting performance reporting.

Walk-Forward Analysis Tabs

Cluster Analysis - Shows a cluster matrix representing the results of each incremental test of Out-Of-Sample% (OSS%) and walk-forward runs for a selected Display category and WFA Type.

Optimization Summary (In-Sample) - Shows a summary of the in-sample results for a set of walk-forward runs.  For cluster analysis results, the Run number correlates with the Runs column in the Cluster Analysis matrix for the selected cell and the inputs reflect the specific input combination tested for a given Run.

Walk-Forward Summary (Out-Of-Sample) - Shows a summary of the out-of-sample results for a set of walk-forward runs.  For cluster analysis results, the Run number correlates with the Runs column in the Cluster Analysis matrix for the selected cell and the inputs reflect the specific input combination tested for a given Run.

Test Results - Displays the Test Criteria Result score and commentary for a set of walk-forward runs.  For cluster analysis results, the OOS% and WFRuns value at the top of the tab represents a selected cell in the Cluster Analysis matrix.

Graphs - Plots a graph of results for a set of walk-forward runs based on the specified equity factor.

P/L History - Shows the P/L for all of the trades considered as part of a set of walk-forward runs.  For cluster analysis, the OOS% and WFRuns value at the top of the tab represents a selected cell in the Cluster Analysis matrix.

Performance Summary - Shows a summary of the performance for a set of walk-forward runs.  For cluster analysis, the OOS% and WFRuns value at the top of the tab represents a selected cell in the Cluster Analysis matrix.

Sensitivity Analysis - For a Single Walk-Forward Analysis, lets you study how an individual optimization parameter impacts the performance of your strategy.  

Distribution Analysis - Allows you to evaluate the trades that make up a strategy by graphing various performance criteria against selected market criteria.

Walk-Forward Optimization

WFO can turn a complex task like a walk-forward analysis into an exciting adventure.

To perform a proper walk-forward analysis a user simply needs to do the following steps:

From the TradeStation Platform
  1. Set input optimization values for each desired strategy applied to a TradeStation chart.
  2. Select Walk Forward as the optimization type and set a Walk-Forward Test Name to have all necessary information saved to a WFO trading history file to perform the walk-forward analysis after the optimization process in TradeStation is completed.
  3. Select Exhaustive or Genetic as the optimization method and click Optimize to run the TradeStation optimization.
  4. Launch the TradeStation Walk-Forward Optimizer.
From the TradeStation Walk-Forward Optimizer
  1. Open a Walk-Forward Test Name containing the trading history files exported data from the TradeStation Exhaustive/Genetic optimization.
  2. Perform the walk-forward analysis (single or cluster) on the exported data. The user simply needs to specify two inputs: the required number of walk-forward runs as well as the size of the out-of-sample windows. The user can also choose between a rolling forward walk-forward or anchored walk-forward optimization.

Because the computational intensive walk-forward analysis is performed by the integrated TradeStation WFO, it is much faster than if it was to be performed in EasyLanguage or an external spreadsheet.

Test Results

Using the default settings, a trading strategy passes a walk-forward analysis if it:
 

If the strategy fails any of the individual performance criteria tests, the strategy is failed overall and may not be suitable for real-time implementation and trading.

To accommodate individual preferences in performance evaluation, the WFO allows users to set the pass/fail percentages themselves (using Setup > Test Criteria Settings).

Rolling Walk-Forward Optimization

With rolling walk-forward optimization, the in-sample window (e.g. 2 years) is shifted forward to encapsulate the most recent out-of-sample period (e.g. 6 months). The new shifted two year window is then re-optimized. When the top model is found for this window, it is again tested on the next 6-month test window. This process is repeated until all walk-forward tests are completed.

Anchored Walk-Forward Optimization

With anchored walk-forward optimization, the beginning of the in-sample window is fixed at the initial/original starting point.

Walk Forward Analysis

A Walk-Forward Analysis (WFA) is the most realistic simulation of the way a trading strategy is used in real time. It also helps to answer the following important questions:

  1. Will the trading strategy continue to make money after optimization?
  2. At what rate can I expect the strategy to make money on unseen data?
  3. What will be the impact of changes in trend, volatility and liquidity on performance in future?
  4. How often should a trading strategy be re-optimized?

Answering the above questions provides the following benefits:

  1. It helps to verify the forward-trading ability of the strategy (i.e. does the strategy have life after optimization and does it have the potential to make money in real time?) It detects if a strategy has been overfit (curve fit) or improperly optimized. For example, studies have shown that a randomly chosen, poor or overfit strategy can make money in one or two walk-forward tests, but will not make money over a large number of walk-forward tests. A strategy that makes a profit over a large number of walk-forward tests is more likely to be successful in future.
  2. It reliably measures the rate of post-optimization profit and risk. A WFA produces a statistical profile of multiple in-sample optimizations and out-of-sample trading periods. Because it is based on a much larger sample than testing a single period of unseen data, it offers greater statistical validity. It also makes possible a precise comparison and measurement of the rates of out-of-sample versus in-sample trading profit. (A robust strategy’s future performance should be at levels similar to those achieved during optimization)
  3. A WFA also provides insight into the impact of trend, volatility, and liquidity changes on strategy performance. While these changes can have a very negative impact on trading performance, a robust strategy will be capable of responding profitably to such changes.
  4. A WFA determines empirically how often a strategy should be re-optimized for optimal performance.

During the WFA, the DetailAnalysis grid will gather the results for each individual run performed. This detail can be used to audit the walk-forward process or to look in detail at the behavior of a strategy during certain periods. A filter can also be enforced on the walk-forward detail, e.g. you may select to display in/out-of-sample detail only for those runs where %Profitable>=40 and Profit factor>=1.5   

For both the in-sample and out-of-sample data, the Detail report includes all the statistics that are available in the TradeStation Strategy Optimization Report.

While a single WFA may give a preliminary indication of whether a strategy is robust, a Cluster Analysis of multiple walk-forward analyses is generally a better method for proving or disproving the validity of a trading strategy and optimization procedure.