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() );