Skip to content
All library documents

Filtering Open Orders for Expert Advisors

Article MQL5 code base

Summary

This brief programming note addresses a common Expert Advisor problem: identifying whether the system itself has open orders when the platform’s total-order count also includes orders placed manually. It introduces a boolean function called Check_Open_Orders as a way to make that distinction, and says that the platform’s Comment function is used to demonstrate the check live on a chart.

The document describes the goal and demonstration approach, but the actual function implementation is not included in the supplied text. It provides no testing results, details about how orders are identified, or discussion of edge cases such as multiple strategies sharing an account. As a result, it can orient readers to the order-filtering problem, but does not provide enough detail to assess or reproduce a robust solution. The central practical lesson is to distinguish an EA’s own orders from the account’s total open orders when building automated trading logic.

Key ideas

  • The platform’s total open-order count can include both manually placed orders and orders opened by an Expert Advisor.
  • The note proposes a boolean check to determine whether an EA has open orders.
  • A chart comment is used to demonstrate the check in real time.
  • The supplied text omits the function implementation and gives no test results or edge-case handling.

Tags

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