SetCustomBacktestProc("");//AIRAP
if(Status("action")==actionPortfolio)
{bo=GetBacktesterObject();
bo.Backtest();
st=bo.GetPerformanceStats(0);
airap=
((1+st.GetValue("NetProfit")^(-3))
/st.GetValue("AllQty")
)^(1/(-3))-1;
bo.AddCustomMetric("AIRAP",airap);}
However I don't know how to include the sum of this equation part: (( 1 + TRi ) ^ (-3))/N , in other word I cannot implement "Ó". I've been trying to achieve that using <sum()> function, without success though.
Can you show me some way to transcript AIRAP equation into AFL? Maybe there is some part of User Guide dealing with this issue which I've overlooked or some papers on that in Knowledge Base?
I will be grateful for any advice or trace :)
Regards
Tomasz