PureBytes Links
Trading Reference Links
|
Hermann,
it works fine( thanks Ken for the tips)
a question to Tomasz, why StrFormat does not work?
nb=Optimize("Comp",1,10,50,1);
//Ticker=StrFormat("~MFI%f",nb);
//Comp = Foreign(Ticker, "X");
Comp = Foreign("~MFI" + WriteVal(nb , 1.0 ), "X");
to resume to others users
////////////////////////
//Creation of Multiples composites
/////////////////////
for(Nb=4;Nb<30;Nb++)
{
Comp=IIf(MFI(Nb)>50,1,-1);
AddToComposite(Comp,"~MFI" + WriteVal(Nb,1.0),"X");
Buy=0;
}
////////////////
//BACKTEST and optimization with composites
//////////////////
/**Optimize Trend**/
nb=Optimize("Comp",10,10,50,1);
Comp = Foreign("~MFI" + WriteVal(nb , 1.0 ), "X");
Trend= Comp >0 ;
/**Buy**/
Buy= Cross(CCIa(C,14),100) AND Trend ;
Sell=ExRemSpan(Ref(Buy,-2),2);
> Perhaps something along the lines of:
>
> nb = Optimize("Comp",1,1,4,1)
> CompMFI = Foreign("~MFI" + WriteVal( 5 * nb , 1.0 ), "X");
>
> herman
> -----Original Message-----
> From: Stephane Carrasset [mailto:nenapacwanfr@x...]
> Sent: November 8, 2003 6:51 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] shorcut to optimize
>
>
> Hello,
>
> If I do a backtest with an optimization on multiples composites
> is there a shorcut to this code below if I have 100 composites to
> avoid iiiiiiiiiiiiiiiiiiiiiiif 100 times.
>
> stephane
>
> /**Optimize Trend**/
> Comp1=Foreign("~MFI10", "X") ;
> Comp2=Foreign("~MFI15", "X") ;
> Comp3=Foreign("~MFI20", "X") ;
> Comp4=Foreign("~MFI25", "X") ;
>
> nb=Optimize("Comp",1,1,4,1);
> CompMFI=IIf(nb==1,Comp1,IIf(nb==2,Comp2,IIf(nb==3,Comp3,Comp4)));
> Trend= CompMFI >0 ;
>
>
>
> Yahoo! Groups Sponsor
> ADVERTISEMENT
>
>
>
>
> Send BUG REPORTS to bugs@xxxx
> Send SUGGESTIONS to suggest@xxxx
> -----------------------------------------
> Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> --------------------------------------------
> Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service.
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
|