Walk Forward Optimization: Difference between revisions
From MultiCharts
→Using Walk Forward Optimization
No edit summary |
|||
(6 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
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. | 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. | 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. | ||
Line 5: | Line 7: | ||
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. | 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) == | <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. | Suppose a data series has 220 bars, and it is divided into five segments of 100 bars per segment. | ||
Line 21: | Line 24: | ||
!width="25%"|OOS | !width="25%"|OOS | ||
|- | |- | ||
Segment 1 | |Segment 1 | ||
|align="center"|1-70 | |align="center"|1-70 | ||
|align="center"|71-100 | |align="center"|71-100 | ||
|align="center"|100 | |align="center"|100 | ||
|- | |- | ||
Segment 2 | |Segment 2 | ||
|align="center"|31-100 | |align="center"|31-100 | ||
|align="center"|101-130 | |align="center"|101-130 | ||
|align="center"|100 | |align="center"|100 | ||
|- | |- | ||
Segment 3 | |Segment 3 | ||
|align="center"|61-130 | |align="center"|61-130 | ||
|align="center"|131-160 | |align="center"|131-160 | ||
|align="center"|100 | |align="center"|100 | ||
|- | |- | ||
Segment 4 | |Segment 4 | ||
|align="center"|91-160 | |align="center"|91-160 | ||
|align="center"|161-190 | |align="center"|161-190 | ||
|align="center"|100 | |align="center"|100 | ||
|- | |- | ||
Segment 5 | |Segment 5 | ||
|align="center"|121-190 | |align="center"|121-190 | ||
|align="center"|191-220 | |align="center"|191-220 | ||
Line 57: | Line 60: | ||
Step 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. | Step 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. | 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 | 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> | <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> | ||
[[File:Wfoptimization1.png]] [[File:Wfoptimization2.png]] | |||
<br> | <br> | ||
== Walk Forward Optimization (anchored) == | == Walk Forward Optimization (anchored) == | ||
Line 82: | Line 90: | ||
!width="25%"|OOS | !width="25%"|OOS | ||
|- | |- | ||
Segment 1 | |Segment 1 | ||
|align="center"|1-70 | |align="center"|1-70 | ||
|align="center"|71-100 | |align="center"|71-100 | ||
|align="center"|100 | |align="center"|100 | ||
|- | |- | ||
Segment 2 | |Segment 2 | ||
|align="center"|1-100 | |align="center"|1-100 | ||
|align="center"|101-130 | |align="center"|101-130 | ||
|align="center"|130 | |align="center"|130 | ||
|- | |- | ||
Segment 3 | |Segment 3 | ||
|align="center"|1-130 | |align="center"|1-130 | ||
|align="center"|131-160 | |align="center"|131-160 | ||
|align="center"|160 | |align="center"|160 | ||
|- | |- | ||
Segment 4 | |Segment 4 | ||
|align="center"|1-160 | |align="center"|1-160 | ||
|align="center"|161-190 | |align="center"|161-190 | ||
|align="center"|190 | |align="center"|190 | ||
|- | |- | ||
Segment 5 | |Segment 5 | ||
|align="center"|1-190 | |align="center"|1-190 | ||
|align="center"|191-220 | |align="center"|191-220 | ||
Line 113: | Line 121: | ||
== Using Walk Forward Optimization == | == Using Walk Forward Optimization == | ||
To use Walk | To use Walk Forward Optimization: | ||
:1. Open the '''Format Objects''' window.<br><span>{{FormatObjectIS}}</span> | |||
:2. Select the '''Signals''' tab and select the signal in the box. | |||
:3. Click the '''Optimize''' button. The '''Optimization Settings''' window will appear. | |||
:4. Select the optimizable inputs and optimization method – exhaustive or genetic (both will work with '''Walk Forward Optimization'''.) Please refer to [[Performing_Optimization]] for more information. | |||
:5. Click '''Next''', and the '''Set Walk-Forward Parameters''' section will appear. | |||
:6. There are two possible types of segmentation for Walk-Forward Optimization: by number of runs and by time span. Select the desired one in the '''Segments Type''' section. | |||
:7. If '''Number of Runs''' is selected:<br> | |||
Enter the number of runs into the '''Number of Runs:''' textbox. | |||
<br>Enter the percentage number for the OOS portion of a segment into the '''OOS, % of first Run:''' textbox. | |||
<br>When '''Number of Runs''' is selected, the segmentation is always performed according to bars. | |||
:8. If '''Time Span''' is selected:<br> | |||
Enter the number of bars/days for the IS portion of a segment into the '''IS''' textbox.<br> | |||
Enter the number for the OOS portion of a segment into the '''OOS''' textbox. The number can be expressed as a percentage, if '''% of the first Run''' is selected in the next dropdown list, or in bars/days, if '''same as IS''' is selected there. | |||
:9. Check the '''Anchored''' checkbox to use anchoring. Uncheck the '''Anchored''' checkbox to not use anchoring. | |||
:10. Click the '''Next''' button. | |||
:11. In the '''Set Robustness Settings''' section set up the criteria according to which the robustness of the strategy will be estimated. For more information about Strategy Robustness click on [https://www.multicharts.com/trading-software/index.php/Strategy_Robustness '''What is Robustness?'''] link. | |||
:12. Click '''Analyze N Combinations''' to run Walk-Forward Analysis and generate the Walk-Forward Optimization Report. | |||
<br> | <br> | ||
[[Category:Optimization]] | [[Category:Optimization]] |