Title: How to use AddCustomMetric() to add external values
I want to simply add numerical values (in columns) from an external function to the BT report.
1) Can someone tell me why the code below does not work? Also, what is the minimum code to accomplish this?
2) Is it possible to add a text column?
Thanks,
herman
function Test()
{
return LastValue( Open );
}
SetOption( "UseCustomBacktestProc", True );
if ( Status( "action" ) == actionPortfolio )
{
bo = GetBacktesterObject();
bo.PreProcess();
for ( bar = 0; bar < BarCount; bar++ )
{
bo.ProcessTradeSignals( bar );
}
T = Test();
bo.PostProcess();
bo.AddCustomMetric( "Test", T );
}
// My trading system would be here
Short = Cover = 0;
Buy = Cross( MACD(), Signal() );
Sell = Cross( Signal(), MACD() );
__._,_.___
**** IMPORTANT ****
This group is for the discussion between users only.
This is *NOT* technical support channel.
*********************
TO GET TECHNICAL SUPPORT from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
*********************
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
For other support material please check also:
http://www.amibroker.com/support.html
*********************************
__,_._,___
|