blocked script after 21hrs : can because of how I read time ?

fw1555
15
fw1555  

i am unsure why my script gets blocked after ~21 hours.

it runs every 3 seconds or 5 minutes.


kindly please advise, especially if there is a way to debug and find where the code is getting blocked and potentially why ! 


One thought:

https://www.mql5.com/en/docs/predefined/_stopflag

The _StopFlag variable contains the flag of the mql5-program stop. When the client terminal is trying to stop the program, it sets the _StopFlag variable to true.


how can the client terminal trying to stop the program ? why ?

This example is terrifying :)) - could someone elaborate how this works ?

https://www.mql5.com/en/docs/basis/operators/for

or it may be because I use the Alert function instead of Comment ? and the window is crashing ??

My high level code structure looks like this (it has few thousands lines of code):


#definition vars

int OnStart(){

while(true)
analysis: for 1
exec orders: for2

}

i use GetTickCount() or GetMicrosecondCount() as variable control relative to time.
When i was using just Sleep () things were not getting stuck (as I recall - but can't go back to that... too infantile)
all variables are declared properly (ulong, uint, int, double and so on...)


Documentation on MQL5: Predefined Variables / _StopFlag
Documentation on MQL5: Predefined Variables / _StopFlag
  • www.mql5.com
The _StopFlag variable contains the flag of the mql5-program stop. When the client terminal is trying to stop the program, it sets the _StopFlag variable to true.