Why the result in optimization table in column "Number" is N/A when I
apply the next code:

Number = (y2 - y1) / (x2 - x1);
SetCustomBacktestProc("");
if( Status("action") == actionPortfolio )
{
bo = GetBacktesterObject();
bo.Backtest();
bo.AddCustomMetric( "Number", Number );
}
printf( StrFormat( "Number: %g.\n", Number ));

This "(y2 - y1) / (x2 - x1)" estimates OK, no errors.


More over, example below estimates also ok and I see "2" in "Number"
column:

Number = 1 + 1;
SetCustomBacktestProc("");
if( Status("action") == actionPortfolio )
{
bo = GetBacktesterObject();
bo.Backtest();
bo.AddCustomMetric( "Number", Number );
}
printf( StrFormat( "Number: %g.\n", Number ));

Reply via email to