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

[amibroker] Historical performance per period



PureBytes Links

Trading Reference Links




Divide the previous data into n segments and see the 
performance of a trading system per segment.
For IB, set scaling to *Automatic and follow the performance 
for each period.
For AA, explore the current stock for the n=1 last 
quotations.
In the results list you will have the final Equitys per 
segment.
 
// Historical Performance per 
period
SetOption ("NoDefaultColumns" 
,True);AddTextColumn(Name(),"Name");Buy=Cross(StochD(),30);Sell=Cross(StochD(),80);begin=50;// 
the starting bar of the testbars=100;// the segment 
lengthnmax=floor(LastValue(Cum(1))/bars);for(n=0;n<nmax;n=n+1){start=Cum(1)==begin+n*bars;end=Cum(1)==begin+(n+1)*bars;from=LastValue(ValueWhen(start,DateNum()));to=LastValue(ValueWhen(end,DateNum()));Buy=Cross(StochD(),30);Sell=Cross(StochD(),80) 
;// The trading 
rulese=Equity(1,3,from,to);Plot(e,"\n["+WriteVal(n,1.0)+"]=",n+1,1);AddColumn(e,"["+WriteVal(n,1.0)+"]");}Filter=1;
 
Dimitris Tsokakis






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.