A built-in MQL5 variable that stores the code of the last runtime error. After any failing operation (e.g. file I/O or trade function), check _LastError
or call GetLastError()
to diagnose issues. For example, receiving an “array out of range” sets _LastError
to a specific code. Resetting it (GetLastError()
or manually) is important before retrying operations.