PureBytes Links
Trading Reference Links
|
Thanks for the reply MAX. I had never thought to use Optimize & IIF in
that way. Always learn something from this group. Your solution works
easy for 2 solutions without nesting IIF's..
It seems the solution I saw a year or more ago involved putting
solutions into Array Elements ( OptiBUY[1]= solution1 ... OptiBUY[7]=
Solution7 )or something like that.. When I try to do this Errors about
array on right side beat me up.. Plus I wouldn't know how to Optimise
that. So if anyone recalls that approach, please respond.
Thanks again MAX, that will help me. Jack Kinsey
--- In amibroker@xxxxxxxxxxxxxxx, "fanziguk" <maxdanzig@xxxx> wrote:
> How this?
>
> OptiBUY = Optimize("OptiBUY ", 0, 0, 1, 1 );
> ADXBUY1 = IIf( Cross(PDIline, MDIline) AND ADXline > Ref(ADXline, -
> 1),1, 0);
> ADXBUY2 = IIf(PDI(Range) > Ref(PDI(range), -1), 1, 0);
> Buy = if(OptiBUY,ADXBUY1,ADXBUY2); // 1=ADXBUY1, 0 = ADXBUY2
>
> Max
>
>
> --- In amibroker@xxxxxxxxxxxxxxx, "ckinsey2003" <ckinsey2003@xxxx>
> wrote:
> > It seems I read somewhere there is a way you can "Optimize" for
> > different Arrays, each acting as a "BUY trigger" for example. I
> can't
> > find it in the Help though.. For Example, this code helps show what
> I
> > am trying to do. I want to know (in 1 optimization) is it better to
> > use ADXBUY1 or ADXBUY2 as a BUY trigger ? as further explained in
> the
> > comment code near the bottom of the program.
> >
> > range = Optimize("Periods", 7, 2, 60, 1 );
> > ADXline = ADX(range);
> > PDIline = PDI(range);
> > MDIline = MDI(range);
> > Plot( ADXline, "ADX", colorLightGrey, styleLine);
> > Plot( PDIline, "+DI", colorGreen , 1 );
> > Plot( MDIline, "-DI", colorRed , 1 );
> >
> > Title = "ADX = " + ADXline + " PDI = " + PDIline + " MDI = " +
> > MDIline + "\nRange = " + range;
> >
> > ADXBUY1 = IIf( Cross(PDIline, MDIline) AND ADXline > Ref(ADXline, -
> 1),
> > 1, 0);
> > ADXBUY2 = IIf(PDI(Range) > Ref(PDI(range), -1), 1, 0);
> >
> > /* Here I would like to Optimize both ADXBUY1 and ADXBUY2 while
> > also Optimizing for the Periods above, to find the better
> combination
> > and put the results in OptiBUY for Optimizing & Backtesting.. */
> >
> > ADXSELL = IIf(ADXline < Ref(ADXline, -1), 1, 0);
> >
> > Buy = OptiBUY;
> > Sell = ADXSELL;
> >
> > Any ideas and examples would be greatly appreciated. Can it be
> done ??
> >
> > Jack Kinsey
------------------------ Yahoo! Groups Sponsor --------------------~-->
Has someone you know been affected by illness or disease?
Network for Good is THE place to support health awareness efforts!
http://us.click.yahoo.com/Rcy2bD/UOnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~->
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 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/
<*> 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/
|