Errors appear only in Optimization, impossible to debug!

 

We are experiencing for some time a problem with an expert advisor we are making.

Straightforward tests with the Strategy Tester do not show any errors, however there is a peculiar error appearing on some runs in the Optimizer.

The line where it breaks with error is the one assigning the crt value to the array element.

As you can see, the array is resized just in case the requested row would be outside its first dimension.

 

          //fix for rows outside array

          if (row==ArrayRange(matrix,0))

             ArrayResize(matrix,row+1,row+30);

          //end fix

          matrix[row,col]=crt;

 

 

The column starts at zero at every procedure call and is incremented only on some matches in a parameter string. The matrix array starts initially with 400 columns.

Before every exit of the procedure, if the col exceeds a critical level, matrix is scrolled left and the parameter string is being cut a number of characters equal to

what is thrown away by scrolling. So practically the col number should never exceed the limits of the matrix array.

 

Given that we are not getting this error on our trials in the Strategy Tester, we do not know if the problem is in our EA code or the problem is in the Optimizer,

and thus, we can't complete the optimization. We attempted to log the parameters on entry and mark the execution of OnDeinit(), but when running thru specific

parameter sets that show OnDeinit was not executed, it just tells the results were discarded - the array error is not procced.

 

Is there any way around this problem, to know exactly which parameter set causes an error in the optimizer ?

Thank you.

 

You don't even say what error you are talking about.

 
The error i`ve got is Array Out of Range