Skip to content
All library documents

Decoding MetaTrader Trade Request Result Codes

Article MQL5 code base

Summary

The document explains a helper function for turning MetaTrader trade-operation return codes into readable text. It shows how the function can report the result of checking a trade request with OrderCheck, and how it can describe the result returned by OrderSend after an order is submitted.

The function depends on an included header library that supplies the descriptions. The examples illustrate logging a failed check or order send and recognizing a completed buy order. This is an implementation aid for interpreting platform responses, not a trading strategy; the document gives no guidance on handling individual error codes or evidence about execution outcomes.

Key ideas

  • A helper function converts MetaTrader trade return codes into readable descriptions.
  • It can be used with results from both request validation and order submission.
  • The required description library must be included in the program.
  • The examples demonstrate logging outcomes but do not explain how to resolve specific errors.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.