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

Re: [amibroker] ParamOptimize - different backtest results



PureBytes Links

Trading Reference Links

Thanks again, Tomasz - your comments clarify this issue completely!

Best regards,
Thomas

> Thomas,
>
> Yes, that's the key. If you use ParamOptimize then it behaves
> like PARAM function - i.e. you need to use Parameters dialog
> to reset values to defaults (Press "RESET" button), otherwise
> ParamOptimize will work like Param - i.e. will return (old values).
>
> Also each indicator window and AA window parameters are
> INDEPENDENT (which means that if you change indicator
> parameters, AA parameters are NOT affected).
>
> Best regards,
> Tomasz Janeczko
> amibroker.com
> ----- Original Message -----
> From: "Thomas Ludwig" <Thomas.Ludwig@xxxxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Thursday, December 14, 2006 11:45 AM
> Subject: Re: [amibroker] ParamOptimize - different backtest results
>
>
> Thanks, Tomasz,
>
> Below is the code I was using.  As mentioned, I backtested this formula
> with the default values, replaced "Optimize" with "ParamOptimize" and got a
> different backtest result.
>
> However, your remark:
> >Note that BACKTEST in second case will use current param values,
> > not the defaults.
>
> made me think about this matter once more. I'm not sure if this system was
> plotted as an indicator when I performed these backtests. If the meaning of
> your comment is that in this case "ParamOptimize" uses the (different)
> param values of the plotted indicator and not the default values (=optimal
> values
>
> >from the optimization which I had manually entered) then this is a trap I
>
> wasn't aware of. In order to evaluate this, I repeated the tests today
> without the indicator plotted with different param values - and this time
> the results were identical. So this is obviously the explanation I was
> looking for.
>
> Thanks again!
>
> Greetings, Thomas
>
>
> function ParamOptimize( TitleName, default, minv, maxv, step )
> {return Optimize( TitleName, Param( TitleName, default, minv, maxv, step ),
> minv, maxv, step );}
>
>
> function LinearRegReversal( array, period )
> {
>   Lr = LinearReg( array, period );
>     return IIf( Lr >= Ref( Lr, -1 ), 1, -1 );
> }
>
>
> p=Optimize("ER-Berechnungszeitraum",17,10,40,1);
>
> z=abs(C-Ref(C,-p));
> n=Sum(abs(C-Ref(C,-1)),p);
>
> ER=z/n;
> d=Optimize("Glättung",21,15,30,2);
> ER=EMA(ER,d);
>
> per=Optimize("LRR-Period",120,60,120,2);
> per=round(per/ER);
> LRR=LinearRegReversal(C,per);
>
> Plot( LRR, "LR Reversal mit ER", colorBlue);
> PlotGrid(1);
> PlotGrid(-1);
> GraphXSpace=10;
>
> SetTradeDelays(1, 1, 1, 1);
> Buy=LRR ==1;
> Sell=LRR ==-1;
> Cover=Short=0;
>
> Buy1=ExRem(Buy,Sell);
> Sell1=ExRem(Sell,Buy);
> shape = Buy1 * shapeUpArrow + Sell1 * shapeDownArrow;
>
> //Plot( Close, "Price", colorBlack, styleCandle );
>
> PlotShapes( shape, IIf( Buy1, colorGreen, colorRed ), 0, 0 );
>
> > Send full code you are using. The reason may be invalid formula
> > (for example using same names for different params).
> > You are not saying whenever you run BACKTEST or OPTIMIZE.
> >
> > Note that BACKTEST in second case will use current param values,
> > not the defaults.
> >
> > Best regards,
> > Tomasz Janeczko
> > amibroker.com
> > ----- Original Message -----
> > From: "Thomas Ludwig" <Thomas.Ludwig@xxxxxx>
> > To: <amibroker@xxxxxxxxxxxxxxx>
> > Sent: Wednesday, December 13, 2006 9:02 PM
> > Subject: [amibroker] ParamOptimize - different backtest results
> >
> > > In the Amibroker Feedback Center is a request for an "Optimizable
> > > Param()" . Graham and Tomasz pointed out that this functionality
> > > already exists via the following function:
> > >
> > > function ParamOptimize( TitleName, default, minv, maxv, step )
> > > {return Optimize( TitleName, Param( TitleName, default, minv, maxv,
> > > step ), minv, maxv, step );}
> > >
> > > As a matter of fact I had used this function before but had had
> > > problems with it. Now I took the opportunity to try it out again. I
> > > tested a trading system at first with using "Optimize" and performed a
> > > second backtest where I replaced "Optimize" with "ParamOptimize"
> > > without any other changes. The results of both backtests were
> > > completely different! This is true regardless if I copy above function
> > > into the formula editor or use it via #include <ParamOptimize.afl>
> > > (this file is in my Formulas/Include" folder).
> > >
> > > Could anybody try out if he/she is confronted with the same problem? If
> > > yes - what could be wrong here?
> > >
> > > Thanks in advance.
> > >
> > > Greetings, 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
> >
> > 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
>
> 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
>
>
>
>
>
>
>
> 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
>
>
>

Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.15.18/586 - Release Date: 12/13/2006 6:13 PM