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

[amibroker] Re: Optimizations



PureBytes Links

Trading Reference Links

Dimitri,
Thanks,I'll test them tuesday

stephane


 wrote:
> Stephane,
> To be more specific:
> PROCEDURE 1:
> Run first the
> /*MEAN RSI*/
> for(n=10;n<=30;n=n+10)
> {
> s1=IIf(RSI(n)>=0 AND RSI(n)<=100,RSI(n),0);
> AddToComposite(s1,"~SUMRSI"+WriteVal(n,1.0),"C");
> }
> AddToComposite(1,"~COUNT","V");
> Buy=0;
> and then, select, for example, ^NDX and optimize
> 
> x=Optimize("x",10,10,30,10);
> MeanRSI10=Foreign("~SUMRSI10","C")/Foreign("~COUNT","V");
> MeanRSI20=Foreign("~SUMRSI20","C")/Foreign("~COUNT","V");
> MeanRSI30=Foreign("~SUMRSI30","C")/Foreign("~COUNT","V");
> MeanRSI=IIf(x==10,MeanRSI10,IIf(x==20,MeanRSI20,MeanRSI30));
> Buy=Cross(MeanRSI,50);
> Sell=Cross(50,MeanRSI);
> Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);
> 
> PROCEDURE 2:
> Select ^NDX and optimize
> 
> period=Optimize("pds",10,10,30,10);
> list = GetCategorySymbols( categoryGroup, 254 );SumRSI = 0; 
MeanRSI=0;
> for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )
>  {
> SetForeign(sym,True,True);   
> f=RSI(period); SumRSI=SumRSI+ f;MeanRSI=SumRSI/(i+1);
>  }
> RestorePriceArrays(True);
> Buy=Cross(MeanRSI,50);
> Sell=Cross(50,MeanRSI);
> Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);
> 
> The results are identical, procedure2 is slow, procedure1 needs two 
steps.
> Dimitris Tsokakis


------------------------ 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/