What MQL4 error 145 means
The official MQL4 runtime table names error 145 ERR_TRADE_MODIFY_DENIED and defines it as “modification denied because order is too close to market.” The requested order change conflicts with the current market distance or broker freeze restriction.
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.
