Skip to content
All library documents

Handling Pending Order Errors with Valid Symbol Settings and Retry Requests

Article MQL5 articles

Summary

This installment in an MQL5 library series addresses pending-order requests that fail because a trading class supplied hard-coded defaults unsupported by a symbol's specification. In particular, an unsupported expiration mode could lead to a server error and prevent order placement. The described correction is to use data valid for the symbol when constructing the request, rather than relying on unsuitable defaults.

The article also extends pending-request objects with descriptions of request parameters for journal output, helping developers inspect and test failed requests and their retries. Its broader subject is robust trade-request handling: recording details such as action, symbol, volume, price, order type, filling and expiration settings, and return code can make diagnosis clearer. The material concerns implementation and operational reliability rather than a trading strategy. It offers no evidence that error handling improves returns, and the text is part of a continuing software-library development series.

Key ideas

  • Hard-coded trading defaults may conflict with a symbol's supported order settings and cause server rejections.
  • Pending order requests should use expiration and other values that match the relevant symbol specification.
  • Logging request parameters in pending-request objects makes failures and retries easier to inspect.
  • The described work improves request construction and diagnostics, not trade selection or strategy performance.
  • The article gives no return or backtest evidence for the library changes.

Tags

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