Walk-Forward Testing and Optimization

Discussion in 'Strategy Building' started by trader3cnd, Mar 7, 2012.

  1. Bill, I think you would be fun to hang out with in real life. I mean come on, it's not like I'm an imbecile who needs to be plonked.

    :D
     
    #11     Mar 8, 2012
  2. jcl

    jcl

    It is an exception. The example strategy was selected so that the students could improve their result with every step. Normally a WFO test gives worse results than an in sample test, but this is sometimes different, especially with strategies based on detecting the dominant cycle of the price curve. They improve a lot with relatively frequent parameter adaption. We have some theories as to the reasons, but this would be beyond the scope of this thread.

    I believe AmiBroker supports WFO and is relatively cheap. Our Zorro supports WFO of course and is free, but it's currently in beta test and will only be released in summer.
     
    #12     Mar 9, 2012
  3. Rita

    Rita

    Another question, how do you set up the training and test time for WFO? Does this depend on how many cycles you're going to test?
     
    #13     Mar 9, 2012
  4. jcl

    jcl

    No, it depends on the strategy. Some strategies are more profitable with short training periods and frequent parameter adaption, others require long training periods with more data.

    Some software tools use cluster analysis for determining the best ratio of training and test period. Normally a ratio like 85:15 or 90:10 works well for most strategies.
     
    #14     Mar 10, 2012
  5. I have run accross many situations where WFO produces much worse results than IN-OOS optimization and testing.

    As a matter of fact, one startegy I tested some years ago worked better with parameters determined when the OOS was eliminated.

    This shows that what works is what works and there is not such a thing as a single method that works in trading. IMO WFO is another trick of brokerages to offer some hope to their declining population of system traders.
     
    #15     Mar 10, 2012
  6. jcl

    jcl

    How did you know that this strategy worked better when you eliminated the OOS? Without OOS you can't test it, unless you're using complicated methods like WRC. When eliminating OOS improved the parameter quality, your in sample period was probably too short and didn't contain enough data for parameter determination.
     
    #16     Mar 10, 2012
  7. ssrrkk

    ssrrkk

    What you are saying is that a local fit is better than a global fit. That is true only in the vicinity of your local fit. Draw a best fit line through 10 years of stock data. Then draw another line through the last 6 months of data. Now which one do you think the market will follow better for the next 3 months? Of course the local fit will do better but at the expense that it will stop working earlier too.
     
    #17     Mar 10, 2012
  8. jcl

    jcl

    That's right of course. For almost all strategies, the effectivity maximum lies at the beginning of the OOS period, and decreases afterwards. So you want to keep the strategy as close to this point as possible.

    Despite its name, WFO is _not_ an optimization. It's a test. It tests the combination of strategy and optimization process. The test tells you the expected performance of this combination, but also the frequency with which the strategy has to re-adapt its parameters for reproducing the test results in real trading. On the strategies we're using, this frequency is normally in the 10 weeks range.

    You're _not_ running the strategy with a WFO generated parameter set. This would not reproduce the WFO test in real trading. Instead, you either have a parameter free system that automatically adapts to the market with a frequency equivalent to the WFO OOS period - that's what Zorro does. Or you have to manually download new price data and run a new parameter optimization every couple of weeks. Both methods keep the strategy at its effectivity maximum.
     
    #18     Mar 11, 2012
  9. I think no matter how much you try you will not convince anyone in this forum. You must try another forum. Maybe there you can achieve your objectives.
     
    #19     Mar 11, 2012
  10. jcl

    jcl

    I think not, as I'm meanwhile so familiar with this forum that I can already identify the trolls. At least one. :)
     
    #20     Mar 11, 2012