Shutdown by timeout deinitialization

 

I deinitialize my expert advisior then the MT4 gets a timeout. -> Abnormal termination


The Initialize works fine but the deinitialize not. I use Classes in Arrays and the arrays are global.

Could this be a problem?


Thank you


EDIT: I know the problem. I have long loops. How can I break up loops when I want to Deinitialize ?

 
Fix your broken code.
 
Christoph Karl Peter Engelhardt:

I deinitialize my expert advisior then the MT4 gets a timeout. -> Abnormal termination


The Initialize works fine but the deinitialize not. I use Classes in Arrays and the arrays are global.

Could this be a problem?


Thank you


EDIT: I know the problem. I have long loops. How can I break up loops when I want to Deinitialize ?

Show your code if you need coding help.
 
Christoph Karl Peter Engelhardt:

EDIT: I know the problem. I have long loops. How can I break up loops when I want to Deinitialize ?

Try IsStopped() function.
 
Christoph Karl Peter Engelhardt: EDIT: I know the problem. I have long loops. How can I break up loops when I want to Deinitialize ?

There is no break up, the documentation says: The OnDeinit() function run is restricted to 2.5 seconds.

You are doing something wrong if your loops take that much time.