It sounds very simple, but I can NOT make it work.

I can run one script for either backtest or optimize. 
1). I add custom metric for optimize, and can see them as I run the script for 
optimize.
2). I add custom metric for backtest, and can NOT see them as I run the script 
for backtest.

The code structruce looks like below. 

//==== run code below for either portfolio backtest, or optimize
if (Status("actionEx") == actionExOptimizePortfolio OR Status("actionEx") == 
actionPortfolio)
{
...
    for ( trade = bo.GetFirstTrade( ); trade; trade = bo.GetNextTrade( ) )
    {
       ...
       //add custom metric as run backtest only
       if (Status("actionEx") == actionPortfolio) {... add custom metrics of 
backtest}
    }

    //add custom metric as run optimize
    if  if (Status("actionEx") == actionExOptimizePortfolio) 
       {... add custom metrics of optimize}
} 

Thanks very much for any help!

Charles

--- In [email protected], "chuck_win" <ch...@...> wrote:
>
> Is it possible to to add custom metric to both backtest and optimize in one 
> script? Otherwise, I have to create one script for backtest and another one 
> for optimize. actually they almost same except those custom metrics.
> 
> Thanks.
> 
> Charles
>


Reply via email to