TradeStation Walk-Forward Optimizer

Frequently Asked Questions

Here is a list of frequently asked questions and answers about the TradeStation Walk-Forward Optimizer (WFO) and Walk-Forward Analysis (WFA).

[ Expand All ]

About WFO & WFA

What makes the WFO unique?

TradeStation WFO is unique in its ability to perform detailed walk-forward analysis in order to help avoid curve-fitting the results of the optimization process.  Also, the WFO enhances the walk-forward process by performing a number of incremental walk-forward scenario tests (Cluster Analysis) in order to help gauge the stability of the tested input parameters.

The WFO offers a number of useful analysis tools and reports that allow you to more easily manage and analyze the large amounts of data generated by the walk-forward optimization process.  The result of the walk-forward analysis can be run through an easy to understand pass/fail analysis of a strategy's key performance criteria.

WFO also lets you customize the walk-forward analysis factors for maximum flexibility in testing and analysis in order to determine the robustness of the trading strategy.  (The definition of a robust strategy is one that produces future performance levels similar to those achieved during optimization.)

Sensitivity Analysis is a WFO feature that lets you study how individual parameters impact the performance of your strategy.

Combined with TradeStation's Genetic optimization feature, large numbers of input combinations can be efficiently tested in much less time than with a brute force (all combinations) approach.

How does the WFO work?

The WFO performs the walk-forward analysis on the performance results generated by the TradeStation Strategy Optimization process.  When optimizing a strategy in TradeStation, the test results can be stored in a file that the Walk-Forward Optimizer will use.  The optimized test results file is opened in the WFO where the walk-forward analysis is performed.  In addition, the WFO can perform a Cluster Analysis that runs through a series of walk-forward scenarios using varying sections of in- and out-of-sample data.  The results are displayed in a number of reports, tables, and graphs.

What is a Walk Forward Analysis?

A Walk-Forward Analysis (WFA) is a method of simulating the way a trading strategy might perform in real-time by testing a strategy's optimized input parameters on a portion of the chart data (in-sample) and then comparing the optimized performance with the remaining un-optimized (out-of-sample) data.

Performing a WFA helps to answer the following important questions:

Answering the above questions provides the following benefits:

It helps to verify the forward-trading ability of the strategy, i.e. does the strategy have life after optimization and will it continue to make money in real time? It detects if a strategy has been overfit or improperly optimized. (Studies have shown that a randomly chosen, poor, or

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)

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.

A WFA determines empirically how often a strategy should be re-optimized for optimal performance.

Where can I read more about Walk-Forward Analysis?

The WFO implements most of the ideas described in the book:  “The Evaluation and Optimization of Trading Strategies” by Robert Pardo [2008].

Mr.

Using WFO & WFA

How many walk-forward runs should be done to validate a walk-forward analysis?

A large enough number of walk-forward tests should be done to overcome random results. A walk-forward analysis including at least 10 walk-forward tests approaches such reliability.

How does WFO implement the walk-forward optimization?

WFO applies a rolling walk-forward optimization as follows:

A starting period of data is automatically chosen by WFO as a function of the number of walk-forward runs and out-of-sample% specified by the user. For simplicity and purposes of this example we will assume this window to be years 1 through 5. If the out-of-sample% is specified as 20, it means that the in-sample segment will be the first 80% (4 years) and the out-of-sample segment the last 20% (1 year) of this window. Next, the most profitable parameter values on the in-sample data segment are found through optimization. These parameter values are then applied to the out-of-sample data, which in this case is year 5. WFO then tabulates and saves the in-sample (year1-4) and out-of-sample results (year 5) on the OptimizationSummary and

Next, the optimization window is moved forward one year (the length of the previous out-of-sample segment), to years 2 through 5, and new optimum parameter values are found and tabulated on the OptimizationSummary.

The new optimum parameters are applied to the out-of-sample year 6, and the out-of-sample results are tabulated on the WalkForwardSummary, and so forth.

The moving optimization window continues to walk forward one year at a time (the length of the out-of-sample segment), finding optimum parameter values for each 4 year optimization window and applying them to the following year (the 20% out-of-sample segment).

(Note that if Anchored Walk-forward is selected, then the starting point of the optimization window is fixed at the initial starting point, thus in this example the first optimization window would be years 1-4, thereafter years 1-5, 1-6 and so forth)

In the end, all tabulated out-of-sample results are merged on the WalkForwardSummary, to create one big out-of-sample results segment. (These combined out-of-sample results can also be used to draw a continuously re-optimized equity curve which can be viewed by selecting

The theory behind this computationally intensive method is that not enough data is available for modelling and finding parameters that will not change over a large span of time. However, enough data is assumed to be available to predict a short time into the future before the model falls apart. It takes time for events to change things, so using the optimum values based upon the previous 4 years for example, is assumed to be adequate to use in the year forward.

What are the ideal optimization ranges and increments to be used with the TradeStation Genetic optimization method?

Unlike an exhaustive search, the time a genetic search takes is NOT proportional to the number of inputs, optimization range's and increments specified. Thus, when working with a genetic optimizer you don't have to be concerned about using larger optimization ranges, nor should you hesitate to use smaller increments for each input being optimized.

If uncertain, you can specify a slightly larger optimization range with the smallest increment that makes logical sense. The genetic optimizer won't have a problem even if you accidently specify an optimization range that was too large.

Why may the underscore or forward slash not be used as part of a symbol or strategy name?

WFO uses the underscore as separator to distinguish between the symbol, interval, strategyname and fitness function while Windows do not allow the forward slash to be part of a filename.

How long does it take to do a complete WFA?

A WFA consist of two phases:

 i) A full optimization in TradeStation (as usual) covering the complete range for each parameter. TradeStation then  with the complete trading history for each parameter combination for the actual WFA to be done at a later stage.

 ii) The actual WFA performed by the WFO stand-alone software (using the trading history files exported by step i)

The usual TradeStation optimization (phase i) takes the longest time by far (that is why TradeStation exports trading history files to WFO instead of trying to do the actual WFA in TradeStation as well). The time a TradeStation optimization takes for 6 parameters is a function of:

1. the length (in time) of the total period under review
2. the total number of iterations/optimization runs specified
3. the speed of the computer you are using

For instance: a daily strategy will usually produce less trades than an hourly strategy over the same period and will thus take a shorter to complete a full range optimization.

We have found that a TradeStation optimization on hourly strategies tested over a history period of 4-10, years takes overnight to complete, thus anything from 4-8 hours, when running on a 2.8GHz computer.

The actual WFA is performed using the stand-alone WFO software. The time of the actual WFA is dependent on the length of the average trading history file, i.e. how many trades the strategy has produced on average during the period as well as the number of files to be analyzed (the number of trading history files will be the same as the number of TradeStation optimization runs).

Usually the actual WFA takes between 10-30 minutes (with 1-3 parameter optimizations), but should not easily take longer than 1 hour if a 6 parameter optimization was done with less than 8000 optimization runs/files.

How many optimization tests should roughly be performed in TradeStation to be able to do a proper Walk-forward analysis?

The number of optimization tests is a function of the number of inputs being optimized. Following is a table that you can use as a guideline to determine the number of optimization steps (increments) recommended for each parameter:

Parameters Steps per parameter Total Tests
2

20 - 40

400 - 1600

3

10 -15

1000 - 3375

4

7 - 8

2401 - 4096

5

5 - 6

3125 – 7776

6

4

4096

For example:

Lets say a trading strategy uses the RSI indicator as well as a moving average to generate signals. This strategy will have the following 4 inputs:

RSI = RSI lookback period

MovAve = Moving Average

OB = Overbought level

OS = Oversold level

Typical optimization parameters would be:

Input

Start

Stop

Increment

 Steps

RSI

5

20

3

6

MovAve

2

40

2

20

OB

60

80

5

5

OS

20

40

5

5

The above optimization ranges would give a total number of 3000 optimizations (6x20x5x5=3000)

IMPORTANT NOTE:

Be careful not to restrict the optimization process too much using large increments between the search parameters, because that can result in making it unrealistically difficult for the strategy to pass the Walk-forward analysis test.

When using WFO together with either the TradeStation Exhaustive or Genetic optimization method, it is recommended that you perform at least 1000 iterations/tests to make sure that WFO gets enough data to be able to perform a proper walk-forward analysis.                    

How does WFO protect against curve fitting?

WFO provides different levels of protection against the curve-fitting that can often result from over optimization:

1)  Stress testing when using the TradeStation Genetic optimization method.

Stress testing is an efficient measure to promote stable parameter selection during the genetic optimization stage. This is achieved by performing a stress test on parameter combinations to see how performance would have deteriorated if all the parameters were changed a certain percentage (which can be set by the user).

When using this feature, users should note that the stress test will increase the total time taken to optimize, by a factor of 2-5 depending of the Stress test size set by the user (the recommended setting is 3).

Set Stress test size parameter on the ‘Advanced Optimization Options’ dialog box to desired level. (Stress test size=1 switches the stress testing feature off)

2) Exclude a certain portion of the data when using the Genetic optimization method in TradeStation .

When using the the TradeStation Genetic optimization method with stress testing enabled you may want to select only a portion of the data (typically 70%) to be used during optimization (i.e. in the Out-of-Sample Settings on the ‘Advanced Optimization Options’ screen, set ‘Exclude first 0% and last 30% of data during optimization’). This helps provide users with a high level of protection against

3)  Cluster Analysis of MULTIPLE Walk-Forward Analysis (WFA’s).

Relying on results of a single WFA (even though it has different walk-forward runs) is dangerous because it does not show one how the result of the WFA as a whole might vary when the parameters that defines the WFA is varied. The Cluster Analysis of multiple WFA’s provides us with a much more complete picture of the true robustness of the underlying strategy.

May I run both a TradeStation optimization and WFO simultaneously?

You may not run both a TradeStation Exhaustive/Genetic optimization and WFO simultaneously on the same strategy/symbol combination because they might access the same trading history files at the same time resulting in an "I/O error 32".

However, you are allowed to perform a TradeStation optimization on a different symbol/strategy while WFO is analyzing  another Walk-Forward Test Name symbol/strategy combination that was previously optimized.

Where is the "Settings for the next NN days found in WFO?

It is found at the bottom of the OptimizationSummary. Just click on the tab and scroll down to the bottom of the page.

Should look inside bar back testing resolution be turned on, when using the WFO?

When evaluating a trading signal for a given bar, TradeStation (TS) assumes the following:

If the Open of the bar is higher than the Close, then TS assumes the High of the bar was made before the Low.

If the Open of the bar is lower than the Close, then TS assumes the Low of the bar was made before the High.

The assumptions are not always true in real life, especially if the open and close was relatively close to each other indicating a bar with sideways market action.

Thus, using these assumptions can then lead to inaccurate backtesting results.

To be prudent and to ensure that you have accurate backtesting results at all times, we recommend that  users should  use look inside bar back testing if the strategy has any intrabar entries or exits.. Using look inside bar back testing will result in the optimization being a bit slower, but at least you know for sure you can trust the results.

Can I apply the WFO to a strategy that uses pyramiding?

One of the main principles of a walk-forward analysis is to monitor the consistency of PL's from one walk-forward run to another.

A strategy that implements pyramiding (or any kind of variable position sizing) may have hugely varying PL's from one walk-forward run to another, which may skew results for a specific out-of-sample period and making it very difficult to objectively interpret the consistency of such results.

For this reason, we do not recommend using the WFO with any strategy that implements pyramiding.

For purposes of a reliable walk-forward analysis, any position sizing/pyramiding algorithm should be switched off, so that the trade lists and P&L's generated are  for a strategy trading in a fixed trading size.

Why/when is the Suggest option for Genetic Optimization Settings not available?

When Type=Walk-Forward in the Optimization Details group box, the Suggest option for Genetic Optimization Settings on the 'Advanced Settings' dialog is not available.

It is important to realize that when using the genetic optimizer (GO) in combination with the WFO, then the goal is slightly different from using the GO on its own.

When using the GO on its own, the purpose is merely to perform an optimization without having to wait days or weeks. Typically, you would have selected "Genetic" because the total number of tests may have been too large had you have selected "Exhaustive" as method.

When using the GO in conjunction with the WFO (i.e. when you have set Type=Walk-Forward on the Format Analysis Techniques & Strategies dialog), the main purpose of the GO is to prepare a genetic sample of tests to be walk-forward tested by the WFO at a later stage.

When Type=Walk-Forward, TradeStation will, during optimization, be writing out complete trade list files to the hard drive and these trade lists are then later on used by the WFO to perform a Cluster Analysis of multiple Walk-Forward Analyses.

Thus, when using GO in conjunction with WFO, the most important factor is that we want to make sure that the GO has generated a sufficient number of trade list files for the WFO so that WFO has enough resolution to perform a reliable cluster/walk-forward analysis.

Increasing the number of optimization tests increases the resolution of our walk-forward test.

Let's use the analogy of a photo. Let's say an average size image has a resolution of 600x400 pixels but we want to display this photo as the background of our computer desktop which has a resolution of 1024 x 768. What we will find is that our 600x400 photo does not look very nice (not a clear picture) because the resolution is too low for a start. Once we increase the resolution to 1024 x 768, our photo will look exactly as we want it to look, thus a clear picture.

However, should we increase the resolution of the photo even more, e.g. 2000x 1600, our photo will still look the same on our monitor and, even if we increase the resolution of the photo to 4000x3200, our photo will still look the same. So by increasing the resolution of our photo beyond 1024x768 we actually have very little benefit. Yes, surely a monitor of 4000x3200 would be the ultimate, but a resolution of 1024 x 768 would be sufficient in most cases and already provide us with a picture that is clear enough for useful and reliable application

The same principle applies to the walk-forward analysis and Cluster Analysis.

If we should provide the Cluster Analysis with a smaller number of tests (trade lists), then the WFO have too little information to work with and the resolution of our walk-forward analysis may not be sufficient. In other words, our picture about the true robustness of the strategy may not be very clear. In WFO terms, the reports produced may not be very trustworthy.

Should we increase the number of optimization tests (thus more trade lists), the WFO will have more information to work with, thus a better resolution. In this case, the WFO will produce a more clear picture of the true robustness of the strategy, i.e. more reliable/trustworthy reports.

What constitutes a good resolution may differ from strategy to strategy but Empirical testing by Grail users over several years have indicated that a sufficient number of tests for WFO purposes would typically lie somewhere between 5000-10000. (1000 tests we recommend as the minimum)

In other words, you want the GO to perform at least 5000 tests and ideally even more.

Also remember that the Total number of tests = Generations x Population size x Stress test size

So now that we know that we ideally want to get to >5000 tests, let's can look at a few ways to achieve this. With a genetic optimization this can be achieved with the following settings, for example:

On the Advanced Settings dialog:

1) Generations = 100 (default)

     Population size = 100 (default)

     Stress test size = 1 (default)

     Early termination NOT checked

In this case the total number of tests would be 100 x 100 x 1 = 10000 tests

2) Generations = 50

     Population size = 50

     Stress test size = 3

     Early termination NOT checked

In this case the total number of tests would be 50 x 50 x 3 = 7500 tests

3) Generations = 50

     Population size = 100

     Stress test size = 3

     Early termination option CHECKED

In this case the total possible number of tests would be 50 x 100 x 3 = 15000 tests, but since "Terminate Optimization if population fitness did not improve for X generations" is checked, the optimization will most likely terminate somewhere between 5000-10000 tests.

Remember that the above are guidelines and are not rules cast in stone.

The general principle is that the more tests we provide WFO as input, the better the resolution and the clearer the "picture" that WFO will be able to draw.

At some stage, one will reach a point where additional tests will provide little incremental benefit, in other words, the picture will already be clear enough and adding more and more tests will not necessarily improve the picture quality.

How clear you want this "robustness picture" to be is up to the user and will be determined by the number of optimization tests performed, refer the 3 samples provided above.

For WFO purposes, we want to use the above guidelines when setting the Generations, Population, and Stress test size and therefore the Suggest button is greyed out.

Additional Information

What is the minimum number of trades that my strategy must generate during the period being analyzed?

To ensure a reliable & trustworthy walk-forward analysis, we need sufficient trades to analyze.

In other words, if we do not provide the Walk-Forward Optimizer with sufficient trades, then it does not have enough information as input as to produce a reliable analysis and reports.

We recommend that the strategy being analyzed should ideally produce at least 30 trades during each out-of-sample run.

Assuming a typical Out-Of-Sample size=20%, it means that the first in-sample period will contain another 120    (30 trades x 80% / 20%) trades.

So for a 10 run walk-forward analysis, you should have 120 trades for the first in-sample run and 300 trades (30 trades x 10 runs) for the combined out-of-sample runs, giving a total of at least 420 trades.

Since a cluster Analysis (CA) may perform WFA's with a greater amount of walk-forward runs, you may need even more trades for CA purposes.

If your strategy does not generate enough trades (e.g. 420 trades in our example) during the total period being analyzed, then you need to increase the trading period being evaluated, thereby increasing the number of trades being generated.

If your strategy produces fewer number of trades, then the Walk-Forward Optimizer will still function, but the walk-forward analysis will not be as reliable as it would have been if the report was based on a larger amount of trades.

The smaller the sample size, the higher the chance of curve fitting.  In general, we want the maximum number of degrees of freedom that can be achieved by having as large a sample size as possible relative to the number of inputs being optimized. The more degrees of freedom, the less the degree of curve fitting.

What is the Out-of-Sample % and what % should be used?

The Out-of-Sample% is that percentage of the initial/moving data window which is allocated to the testing segment, for instance: if the moving data window is 5 years in total, then the first 80% (4 years) will be used as the in-sample segment while the last 20% (1 year) will be used as the out-of-sample (testing) segment.

There is no correct ratio of test data to produce good out-of-sample results.

Research suggests a ratio of between 3 and 9 to 1, i.e. an Out of-Sample% of between 10%-25% (1/10-1/4). Note that the default value of 20% is the recommended setting and can always be used without change.

What is the re-optimized equity curve?

The re-optimized equity curve is the equity curve that is produced if the strategy is continuously re-optimized at the end of each walk-forward run. The equity curve will thus be equal to the profit produced by the first in-sample run plus all the out-of-sample runs afterwards. Note that the equity used for the out-of-sample runs will always be the profit/loss produced by the best performing parameter combination for that specific window, thereby simulating continuous re-optimization. The re-optimized equity curve can be viewed on the Graphs tab by selecting ‘WalkForward Equity’.

Should one specify commission & slippage before using WFO?

Yes, we recommend that a strategy should be optimized taking realistic commission and slippage into account so that we can simulate real-time performance as close as possible.

How do I select the best/most robust strategy when using the TradeStation Walk-Forward Optimizer (WFO)?

First of all one should remember that the main function of WFO is to perform a detailed walk-forward analysis on all the strategies that were either selected by the genetic optimizer or tested during an exhaustive optimization in TradeStation (if genetic optimization was not used).
Thus one is using WFO in the first instance to determine if a strategy is robust at all and is capable to pass the test criteria as defined by the user under Test Criteria Settings. If a strategy fails the walk-forward analysis, then you do not even have to worry about which parameter combination is the best, because WFO tells you that the strategy is not sufficiently robust.

Once a strategy has passed the walk-forward analysis test, you can start worrying about which parameter combination is the best to use.

In this regard, there are two different ways how WFO could be used:

1) You could select the parameters that most frequently appeared on the WalkForwardSummary tab, because this would indicate that a strategy was the best performer during several walk-forward periods2) You could simply select the parameters of the Current run on the

How can I look at the equity curve of any individual strategy?

You can at any time load a specific strategy’s equity graph by using the File, Open menu option but without pressing the ‘Select’ button to select all the history files for that instrument. Then go to the Graphs tab and select ‘System Equity’ to view an equity graph of the strategy.

How much data should I use when doing the re-optimization??

The amount of data that you will be using when doing the re-optimization will depend on whether you have selected Anchored or rolling window (not anchored) walk-forward optimization.

If you have not selected anchored (thus rolling) walk-forward then you will, for instance, re-optimize your strategy every 28 days (the optimal period for example 2 above) with TradeStation genetic optimization, using only the last x day's data, where x is the number of days in the immediately preceding in-sample period. (Note that you must load sufficient data for TS to satisfy its max. bars look back setting. Thus if the max. bars TS may reference is 50, then you need to load load x+50 days history).

If you have selected anchored walk-forward then you will re-optimize your strategy every 28 days with genetic optimization, using ALL the data starting at exactly the same point in time as what you have used for doing the cluster analysis.

What is the concept/benefits behind Stress Testing?

The stress testing feature is available when using the TradeStation Genetic optimization method.

Let's assume that the TradeStation Genetic optimization method generated the following values for a strategy with 3 inputs:

10 20 30

With Stress test size=1 (stress testing off) , the Genetic optimizer will only evaluate this combination.

With Stress test size=2, the Genetic optimizer will subtract 1 x Stress test increment (default=10%) to each input and also evaluate the following additional combination:

9 18 27

With Stress test size=3, the Genetic optimizer will both add and subtract 1 x Stress test increment to each input and

evaluate the following additional combinations:

9 18 27

11 22 33

With Stress test size=4, the Genetic optimizer will both add and subtract 1 x Stress test increment to each input and also subtract 2 x stress test increment thus evaluating the following additional combinations:

9 18 27

11 22 33

8 16 24

With Stress test size=5, the GO will both add and subtract 1 and 2 x Stress test increment to each input, thus evaluating the following additional combinations:

11 22 33

9 18 27

8 16 24

12 24 36

and so forth......

To summarize:

Using the default stress test increment of 10%, the stress test values are calculated as follow for different stress test level settings:

Level Range

1 +/- 0%

2 -10%

3 -10% , +10%

4 -20% , -10%, +10%

5 -20% , -10%, +10%, +20%

6 -30% , -20%, -10%, +10%, +20%

Thus you can see that stress testing is not a test that must be passed, but it is the process of "stressing" the strategy by varying the inputs a certain % in either direction.

In WFO, how do you determine the parameter names for the suggested values to be used for x number of days?

The Input values in WFO are displayed in exactly the same order as in the original strategy. Within WFO, on the Input Ranges tab, you can view the Strategy Input names and ranges that were used during optimization.

I'm getting a Walk-Forward Efficiency (WFE) of >100% on one of my strategies. Is that possible?

The WFO cluster analysis will be able to tell you if it is an aberration or not. If the 100%+ figure is not surrounded by other similar high figures, then it would suggest that it is an aberration. Note that even the cluster analysis can only be trusted if you have used a sufficient amount of data in the first place.

What is the difference between a rolling and anchored walk-forward?

The WFO performs each run completely on its own and each line of results displayed in the WFO OptimizationSummary and WalkForwardSummary represents only the results of that specific run.

However, although the out-of-sample windows (on the WalkForwardSummary) will never overlap, the cutoff periods (start and end dates) of the different in-sample runs (on the OptimizationSummary) will overlap.

This is not only the case with anchored walk-forward but also with rolling walk-forward you will find that the different in-sample windows overlap to some extent.

Even though the in-sample windows overlap, each different run is evaluated on its own.

Graphically it would look like this:

Rolling Walk-forward OOS=20%:

Run #1 |--------- In-sample 80% ---------| OOS 20% |

Run #2 ............... |---------- In-sample 80% ---------| OOS 20% |

Run #3 ................................. |---------- In-sample 80% ---------| OOS 20% |

Anchored Walk-forward OOS=20%:

Run #1 |--------- In-sample 80% ---------| OOS 20% |

Run #2 |----------------- In-sample ----------------------| OOS 20% |

Run #3 |---------------------------- In-sample -------------------------| OOS 20% |

(With anchored walk-forward the length of the 20% OOS is calculated according to the first run)

How does the WFO calculate the in/out-of-sample windows?

The WFO uses bars to calculate the walk-forward window lengths and not dates.

The number of bars per walk-forward run is calculated as follow:

TotalBarsPerRun = Total number of bars / (Walk-forward runs * Out-of-sample% + In-sample%)

InSampleBarsPerRun =

OutOfSampleBarsPerRun =

For example, if all the data has 10000 bars and we apply an out-of-sample%=20% with 10 walk-forward runs, then for a Rolling walk-forward we get:

TotalBarsPerRun = 10000 / (10 * 0.2 + 0.8 ) = 3571 bars

InSampleBarsPerRun = 3571 * 0.8 = 2857 bars

OutOfSampleBarsPerRun = 3571 * 0.2 = 714 bars

Thus we get:

In-sample Out-of-Sample

StartBar

Run#1 1 2857 2858 3572

Run#2 715 3571 3572 4286

Run#3 142 4285 4286 5000

Run#4 2143 4999 5000 5714

Run#5 2857 5713 5714 6428

Run#6 3571 6427 6428 7142

Run#7 4285 7141 7142 7856

Run#8 4999 7855 7856 8570

Run#9 5713 8569 8570 9284

Run#10 6427 9283 9284 9998

The WFO also adds a rule to the calculation to enforce the last out-of-sample window always to continue until the last bar (bar no 10000 in this case) to compensate for cumulative rounding errors.

(resulting in missing out on the last 2 bars in this case, as can be seen from the above example)

For an anchored walk-forward, the in-sample startbar would simply

have been fixed at 1.

Why do some traders select parameters as per the TradeStation Strategy Optimization Report instead of simply using the parameters suggested by the WFO?

TradeStation caters for a wide range of traders with different approaches.

If you follow an approach on consistent re-optimization, then you could simply use the parameters as suggested by the WFO.

However, some traders prefer to select parameters themselves using the TradeStation Strategy Optimization Report to manually filter results and to look at equity curves etc.etc.

Traders who prefer using the Strategy Optimization Report to select their final parameters, should still use the WFO to validate overall model stability of the strategy under scrutiny.

What is the difference between the OOS testing during a regular TradeStation Genetic optimization and the OOS testing done by the WFO?

In the TradeStation platform, when you select 'Exclude first x% and last y% of data' or

'Exclude data before xxxx and after

When using the Walk-Forward Optimizer, the WFO simulates MULTIPLE walk-forward periods where each walk-forward period has its own in-sample and out-of-sample portion. Graphically it looks as follow for a rolling walk-forward:

Rolling Walk-forward with OOS=20%:

Run #1 |--------- In-sample 80% ---------| OOS 20% |

Run #2 ................. |---------- In-sample 80% ---------| OOS 20% |

Run #3 .................................... |---------- In-sample 80% ---------| OOS 20% |

A walk-forward analysis consisting of MULTIPLE walk-forward runs, provides higher statistical significance than a single walk-forward on a single piece of unseen data.

What is the StdDev, Median and t-Test statistic?

These are all statistical terms:

Median is the value right in the middle of an ordered population of trades

e.g. in a population of trade P&L’s [352,124,24,-23,-50,-103,-314], the median is -23.

If a strategy has a %profitable of less than 50%, the median will be negative, because of the fact that there are more losers than winners in the population.

You should not worry if the median is slightly negative.

However, you should worry if the median is a large negative value.

The median is sometimes a more robust statistic than the average because the average can easily be controlled by a few outliers while the median is immune to outliers.

Standard Deviation (StdDev) is a statistical measurement of volatility. High StdDev values signify high volatility, while low StdDev values signify low volatility.

StdDev is the dollar value of 1 standard deviation from the mean (average) of the population, e.g. a value of $657.23 means roughly 68% of all trades should fall within a range of +/- $657.23 of the mean (average trade), on the assumption that the population is normally distributed.

t-Test refers to the statistical t-Test probability using the Student’s

The statistical t-Test determines how likely it is that profitability couldbe due to chance alone. The smaller the number, the more likely the strategy performed the way it did for reasons other than chance.

In the t-Test column, we are using a t-test to compare One sample Mean to an Accepted value. Once the Walk-Forward Optimizer has calculated the t-statistic, it converts that value to a one-tail probability, which is the value shown in the t-Test column. (Please refer to a statistical web-site if you need more information about p-values and converting t-values to p-values)