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

[amibroker] Custom Trade Metrics



PureBytes Links

Trading Reference Links

I am trying to add the custom metric of what the Historical 
Volatility was when the trade was entered. 

I tried the following code, but all I get are blanks. Do we not have 
access to the price arrays? Or what am I doing wrong?

Thank you,
Cey

Here is the code:
SetCustomBacktestProc(""); 
if( Status("action") == actionPortfolio ) 
{ 
   bo = GetBacktesterObject(); 
   bo.Backtest(1); 
   for(trade=bo.GetFirstTrade(); trade; trade=bo.GetNextTrade()) 
   { 
           HVtrade = 100* StDev(log(C/Ref(C,-1)),100)*sqrt(250);
	   trade.AddCustomMetric("HV", HVtrade);
   } 
    bo.ListTrades(); 
} 





Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/