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

[amibroker] Re: Can you Optimize for different scenarios. ?



PureBytes Links

Trading Reference Links

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 --------------------~--> 
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EpW3eD/3MnJAA/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/