In custom backtest trade-by-trade report, after all custom metrics 
are listed, I want to put a column at the end listing the date of the 
trade, the following code is ok, but I hope to make the format of the 
date as the "yyyymmdd", not datenum() format, what should I do the 
formatting here ?

Thanks/ Huanyan



//==================================================================

SetCustomBacktestProc(""); 

/* Now custom-backtest procedure follows */ 

if( Status("action") == actionPortfolio ) 
 { 
    bo = GetBacktesterObject(); 

    bo.Backtest(0); 

    st = bo.GetPerformanceStats(0); 

    for( trade = bo.GetFirstTrade(); trade; trade = bo.GetNextTrade
() ) 
     
     { 

    trade.AddCustomMetric("Date ",  DateTimeConvert( 
0 ,trade.EntryDateTime)); 

     } 

     bo.ListTrades(); 

  }


//=================================================================

Reply via email to