What MQL4 error 4108 means
The official MQL4 runtime table names error 4108 ERR_INVALID_TICKET and defines it as “invalid ticket.” The ticket is invalid for the requested operation. SELECT_BY_TICKET ignores the pool argument and can select history; successful selection alone does not mean an order remains open or modifiable.
An error-state value is supporting context, not proof that a call failed or a diagnosis of the whole EA. For noncritical API failures, read the return value and then GetLastError, which resets _LastError. Critical errors such as zero division terminate execution, so code after the failing expression cannot serve as a recovery handler.
