What MQL4 error 4013 means
The official MQL4 runtime table names error 4013 ERR_ZERO_DIVIDE and defines it as “zero divide.” A calculation attempted to divide by zero, often after an empty sample, unchanged price range, or uninitialized value.
The error number is evidence about one failed call, not a diagnosis of the whole EA. Read the API sentinel first, then call GetLastError immediately because that function returns the current _LastError value and resets it.
