Changes

Jump to navigation Jump to search

Walk Forward Optimization

5,844 bytes added, 17:49, 2 February 2012
no edit summary
Walk Forward Optimization is an optimization process that addresses the issue of curve fitting in strategy development. Walk Forward Optimization segregates the data series into multiple segments, and each segment is divided into an in-sample (IS) portion and an out-of-sample (OOS) portion.
 
Parameter optimization for the strategy is performed using the IS portion of the first segment. The same parameters are then used to back test the strategy on the OOS portion of the same segment. The process is repeated for the remaining segments.
 
The OOS performance results from each of the segments are considered "real" instead of "curve-fit" because the parameters that produced the OOS results were generated from IS data.
 
<br>== Walk Forward Optimization (not anchored) ==
 
Suppose a data series has 220 bars, and it is divided into five segments of 100 bars per segment.
 
The first 70 bars of each segment are the IS portion and the remaining 30 bars are the OOS portion.
 
The table below shows the segmentation details.
 
{| class="wikitable" width="45%"
!width="25%" ROWSPAN="2"|
!width="50%" COLSPAN="2"|Segment
!width="25%" ROWSPAN="2"|#&nbsp;of&nbsp;Bars per&nbsp;Segment
|-
!width="25%"|IS
!width="25%"|OOS
|-
Segment 1
|align="center"|1-70
|align="center"|71-100
|align="center"|100
|-
Segment 2
|align="center"|31-100
|align="center"|101-130
|align="center"|100
|-
Segment 3
|align="center"|61-130
|align="center"|131-160
|align="center"|100
|-
Segment 4
|align="center"|91-160
|align="center"|161-190
|align="center"|100
|-
Segment 5
|align="center"|121-190
|align="center"|191-220
|align="center"|100
|}
 
<br>Step&nbsp;1: Parameter optimization is performed using Segment 1's IS data. These parameters are then used to back test the strategy on Segment 1's OOS data.
 
Step&nbsp;2: Parameter optimization is performed using Segment 2's IS data. These parameters are then used to back test the strategy on Segment 2's OOS data.
 
Step&nbsp;3: Parameter optimization is performed using Segment 3's IS data. These parameters are then used to back test the strategy on Segment 3's OOS data.
 
Step&nbsp;4: Parameter optimization is performed using Segment 4's IS data. These parameters are then used to back test the strategy on Segment 4's OOS data.
 
Step&nbsp;5: Parameter optimization is performed using Segment 5's IS data. These parameters are then used to back test the strategy on Segment 5's OOS data.
 
The walk forward optimization is complete. There are OOS performance results for bars 71-220. Walk Forward Optimization considers the OOS performance results “real” instead of “curve-fit” because the parameters that produced the OOS results were generated from IS data.
 
As shown, the starting point of each subsequent segment begins 30 bars after the starting point of the previous segment. The starting point of each segment steps forward. Hence, this type of walk forward optimization is said to be not anchored. The reason the step is 30 bars is because that’s the length of the OOS portion.
 
<div style="background-color: #E3FBE5;">Note: The significance of OOS results from Walk Forward Optimization is debatable. For more information, please see additional literature about this subject.</div>
 
<br>
== Walk Forward Optimization (anchored) ==
 
Anchoring means the starting point of all segments is the same as the starting point of the first segment.
 
The starting points do not step forward. Hence, this type of walk forward optimization is said to be anchored.
 
The effect is that the IS portion of each subsequent segment is longer than IS portion of the previous segment, and therefore the total length of each subsequent segment is also longer than the total length of the previous segment.
 
The table below shows the segmentation details.
 
{| class="wikitable" width="45%"
!width="25%" ROWSPAN="2"|
!width="50%" COLSPAN="2"|Segment
!width="25%" ROWSPAN="2"|#&nbsp;of&nbsp;Bars per&nbsp;Segment
|-
!width="25%"|IS
!width="25%"|OOS
|-
Segment 1
|align="center"|1-70
|align="center"|71-100
|align="center"|100
|-
Segment 2
|align="center"|1-100
|align="center"|101-130
|align="center"|130
|-
Segment 3
|align="center"|1-130
|align="center"|131-160
|align="center"|160
|-
Segment 4
|align="center"|1-160
|align="center"|161-190
|align="center"|190
|-
Segment 5
|align="center"|1-190
|align="center"|191-220
|align="center"|220
|}
 
The rest of the anchored walk forward optimization process is the same as not-anchored walk forward optimization.
 
<br>
== Using Walk Forward Optimization ==
 
To use Walk forward Optimization:
 
# Open the '''Format Objects''' window.<br><span>{{FormatObjectIS}}</span>
# Select the '''Signals''' tab and select the signal in the box.
# Click the '''Optimize''' button. The '''Select Optimization Method''' box will appear.
# Select either '''Exhaustive''' or '''Genetic''' radio button for the type of optimization. (Both will work with '''Walk Forward Optimization'''.)
# Select the '''Walk Forward''' check box.
# Enter the number of bars/days for the IS portion of a segment into the '''IS''' textbox.
# Enter the number of bars/days for the OOS portion of a segment into the '''OOS''' textbox.
# Check the '''Anchored''' checkbox to use anchoring. Uncheck the '''Anchored''' checkbox to not use anchoring.
# Click the '''OK''' button.
# Select the '''Optimizable Inputs''' tab. Input start and end values for the inputs.
# If performing an''' Exhaustive''' optimization, select the '''Optimization Criteria''' tab and complete inputs. <br>If performing a '''Genetic''' optimization, select the '''Algorithm-specific Properties''' tab and complete inputs.<br>For more information, see [[<span style="color: red;">'''LINK'''</span>0280_Backtesting/22-9002_RunningOpt.html name="1"; |Performing Optimization]]
# Click the '''OK''' button.
<br>
 
[[Category:Optimization]]

Navigation menu