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

[amibroker] help with custom metric



PureBytes Links

Trading Reference Links



Hi!

I've been trying to add custom metric to backtester and optimization funcionalities called AIRAP  (Alternative Investment Risk Adjusted Performance), which is composed as follows:

AIRAP = [  Ó (( 1 +   TRi ) ^ (-3))/N ] ^ ( -1/3 ) -1, where  TR is i-th trade profit and N is number of trades.

I've come to following code:

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



__._,_.___


**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/





Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___