problem with iCustom indicator using strategy tester

 

Hi all, I'm trying to test an expert containing this custom indicator

int DMI_handle;
double DMI_spread[];

   ArraySetAsSeries(DMI_spread,true); 
   
   DMI_handle = iCustom(_Symbol, _Period,"\\Indicators\\Examples\\DMI_spread.ex5",13) ;
   
   CopyBuffer(DMI_handle,0,0,10,DMI_spread);
   
   Print(DMI_spread[1]);

The indicator works well when I apply it on a graph, but testing the expert containing it I see a window like this.

In the strategy Journal there isn't any error or warning but the test does not proceed.

If I remove the indicator from the expert, test works well.

Is there an error in coding?

 
   ArraySetAsSeries(DMI_spread,true); 
   DMI_handle = iCustom(_Symbol, _Period,"\\Indicators\\Examples\\DMI_spread.ex5",13) ;
   CopyBuffer(DMI_handle,0,0,10,DMI_spread);

Your posted code is without context. Are those lines together, or is the iMA/iCustom call in OnInit (where it should be) and the others not?

Always post all relevant code (using Code button) or attach the source file.