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

[amibroker] More Array Processing for Newbies



PureBytes Links

Trading Reference Links

I'm planning to write my own backtesting routine via the Explore, so that I can generate the trade statistics that I want. (ie. normalized returns, Optimal F, etc.)

But I have to understand the fine art of writing loops.  This is a loop to establish a position, that isn't working.  Can anybody please help?

Filter=1;

Period = EndValue( BarIndex() ) - BeginValue( BarIndex() )+1;

i=1;

Pos[0]=1;
while( i < Period) {Pos[i]=IIf(H>Ref(HHV(H,15),-1),1,
IIf(L<Ref(LLV(L,15),-1),-1,Pos[i-1])); i=i+1;}


AddColumn(Pos, "POS", 1.4 );


Thanks
Kevin Campbell






Yahoo! Groups Sponsor


  ADVERTISEMENT 









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 the Yahoo! Terms of Service.