[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Puzzled about Walk-Forward Optimization results



PureBytes Links

Trading Reference Links

Hi Howard,

thanks for answer.

No, you aren't missing something ;-) You are right that HDays and LDays 
are suboptimal in some periods. I did it this way as one step among a 
couple of others in order to separate the effect of the stop parameters 
on the WF equity curve. I had realized that I had applied WFO in a too 
naive manner before and am now trying to get some deeper insights or a 
better feeling how to apply it. 

I had read about WFO already in the first edition of Pardo's book and 
loved the excellent introduction to this topic in your book. When TJ 
implemented it in AB I began eagerly applying it to many system I had 
available as AFL - and was disappointed as the OOS equity curve was 
simply too bad in most cases. I varied the IS and OOS period lengths in 
numerous ways in order to get more reasonable results but that didn't 
really help (although I still hope that TJ will make them optimizable, 
too). After a while I realized what I had done wrong: I had naively 
applied too wide parameter ranges in many cases. This resulted in high 
volatility of the "optimum" parameters in the WFO output table. They 
had adapted themselves perfectly to the respective IS periods but 
failed to be profitable in the subsequent OOS periods. And I learned 
from this experience that even with a very simple system overfitting is 
possible even in a WFO if the parameter ranges are too wide 
(particularly in combination with a possibly too short IS test period 
that prevents generalization). 

So what I'm doing now: I'm WF testing again the systems I regard 
promising. Before doing a WFO I'm doing a simple optimization over the 
whole length of the time series and take the optimum parameters as a 
starting point. In the second step I define parametes ranges rather 
close to these starting points. In the third step I'm modifying these 
parameters ranges very carefully. This is rather time-consuming, but 
with this approach I've got considerably better OOS equity curves for 
some systems than I had got ever before.

Do you know a better technique that helps to get a grip on this problem? 
I don't know if IO does anything about it - I have to look into it 
again.

Thanks again - and I'm looking forward to your new book(s).

Greetings,

Thomas

> Hi Thomas --
>
> Were the optimal values for HDays and LDays the same for all the
> periods? If so, then I would expect the equity curves to have the
> same shape. But if there are some periods where HDays and LDays are
> different, then setting those to be constant for the entire test
> period means that HDays and LDays are suboptimal in some periods.  Or
> am I missing something?
>
> Thanks,
> Howard
>
> On Sat, Sep 6, 2008 at 6:09 AM, Thomas Ludwig <Thomas.Ludwig@xxxxxx> 
wrote:
> >   Hello,
> >
> > I've done a simple WFO and stumbled upon an issue which I'm unable
> > to explain. First of all, this is the simple system I tested:
> >
> > HDays=Optimize("High-Days",14,14,14,1);
> > LDays=Optimize("Low-Days",14,14,14,1);
> >
> > stop=Optimize("ATR-Stop-Days",14,4,5,1);
> > mult=Optimize("ATR-Mult.",2,3,5,1);
> >
> > Buy = Cross(C,Ref(HHV(H,HDays),-1));
> > Sell = Cross(Ref(LLV(L,LDays),-1),C);
> > Buy = ExRem(Buy, Sell);
> > Sell = ExRem(Sell, Buy);
> > Cover=Short=0;
> >
> > ApplyStop(stopTypeTrailing, stopModePoint, mult*ATR(stop), True,
> > True );
> >
> > Buy and sell is at open on next day.
> >
> > Note: I deliberately fixed the HDays and LDays parameters in order
> > to better see the effect of the WFO. Thus, only the stop and mult
> > parameters could change during optimization.
> >
> > In the first attached picture WFO2.jpg you see the concatenated IS-
> > and OOS equity curves. So far, so good.
> >
> > Now I replaced the Optimize() functions for HDays and LDays with
> > Param() - I didn't alter anything else! You see the result in
> > WFO3.jpg.
> >
> > IS equity changed from 148253.98 in the first test to 142124.97 in
> > the second one and OOS equity from 98300.64 to 61157.95!
> >
> > How can replacing just the first two Optimize functions with Param
> > for parameters that did not change during optimization anyway lead
> > to these completely different results?
> >
> > Could someone please reproduce these results?
> >
> > Regards,
> >
> > Thomas



------------------------------------

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/