MQL4 Reference Predefined Variables _StopFlag

MQL4 Help as One File:

bool _StopFlag

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

To check the state of the _StopFlag you may also use the IsStopped() function.