{"id":952,"date":"2007-08-13T05:22:47","date_gmt":"2007-08-13T05:22:47","guid":{"rendered":"http:\/\/www.amibroker.org\/userkb\/2007\/08\/13\/5-io-out-of-sample-and-walk-forward-testing\/"},"modified":"2012-08-17T11:05:38","modified_gmt":"2012-08-17T11:05:38","slug":"5-io-out-of-sample-and-walk-forward-testing","status":"publish","type":"post","link":"http:\/\/www.amibroker.org\/editable_userkb\/2007\/08\/13\/5-io-out-of-sample-and-walk-forward-testing\/","title":{"rendered":"IO – Out of Sample and Walk Forward Testing"},"content":{"rendered":"
This page is obsolete. Current versions of AmiBroker feature built-in non-exhaustive, smart multithreaded optimizer and walk-forward engine.<\/font><\/b><\/p>\n \n<\/a><\/p>\n <\/a><\/a> As a more thorough verification that a system will perform as anticipated, we should always test the system with out of sample data or in other words with data that has not been seen by the In Sample optimization process graphically\u00a0represented by: This can\u00a0be accomplished in AmiBroker by:<\/p>\n \u00a0\u00a0\u00a0 –\u00a0\u00a0 \u00a0Setting the from and to dates for our system to wherever we want<\/p>\n \u00a0\u00a0\u00a0 –\u00a0\u00a0\u00a0 Performing an optimization and choosing the parameter values to use going forward<\/p>\n \u00a0\u00a0\u00a0 –\u00a0\u00a0\u00a0 Changing the default values of the optimization statements<\/p>\n \u00a0\u00a0\u00a0 –\u00a0\u00a0\u00a0 Moving the from and to dates\u00a0forward in time<\/p>\n \u00a0\u00a0\u00a0 –\u00a0\u00a0 \u00a0Running a back test to see how well the system performs.<\/p>\n Besides automating the whole process above,\u00a0IO<\/em> also offers\u00a0more advanced\u00a0alternatives\u00a0such as a fully automated\u00a0calendar or signal based, anchored or rolling Walk Forward optimization and Out of Sample testing which can be made to be very thorough.\u00a0 Graphically the anchored and rolling\u00a0walk forward processes look like this:<\/p>\n <\/a> Without automated tools such as this\u00a0almost no one performs Walk Forward testing because\u00a0of the amount of manual intervention that is required.\u00a0 For example\u00a0think about the\u00a0manual steps\u00a0required to perform\u00a0a Walk Forward test over a 3 year period 3 months at a time\u00a0which are:<\/p>\n \u00a0\u00a0\u00a0 –\u00a0\u00a0 \u00a0Set the from and to dates for the original optimization to begin as of some date in time and end as of 3 years ago<\/p>\n \u00a0\u00a0\u00a0 –\u00a0\u00a0\u00a0 Perform the optimization and choose which parameter values to use going forward<\/p>\n \u00a0\u00a0\u00a0 –\u00a0\u00a0\u00a0 Change the default values of the optimization statements<\/p>\n \u00a0\u00a0\u00a0 –\u00a0\u00a0\u00a0 Move the from and to dates forward<\/p>\n \u00a0\u00a0\u00a0 –\u00a0\u00a0\u00a0\u00a0Run a back test\u00a0for\u00a0the first three months of out of sample data and record the results<\/p>\n \u00a0\u00a0\u00a0 –\u00a0\u00a0\u00a0 Then repeat the whole process\u00a0eleven times, each time moving the end date ( anchored ) or beginning and ending dates ( rolling ) 3 months closer until you run out of data.<\/p>\n Assuming one had\u00a0the means to manually stitch together the out of sample equity curve\u00a0this\u00a0then would provide a real life picture of how the system performed over a 3 year Out of Sample period\u00a0with reoptimization occurring every 3 months.<\/p>\n The above can be accomplished\u00a0in IO<\/em> with no manual intervention and a\u00a0single Walk Forward Directive which is written like this:<\/p>\n \u00a0\u00a0\u00a0 –\u00a0\u00a0\u00a0 WFAuto: Anchored: 3: Months\u00a0<\/p>\n As a result\u00a0even if it takes 15 minutes to optimize each of the 12 segments to accumulate the data necessary to build and show the\u00a0tables and the combined equity curves, it can all be done unattended.\u00a0 As a result one only need to set up a run, get it started and then go find something else of interest to do.\u00a0 Besides the tabular results that are produced by IO<\/em> it is also capable, with an included AFL, of showing an accurate composite\u00a0of the In and Out of Sample equity curve in AmiBroker\u00a0that looks like what is below:<\/p>\n
\n<\/a><\/a><\/p>\n
\n<\/a><\/p>\n
\n<\/a><\/p>\n