Skip to content
All library documents

Designing a Robust Order Interface for a Real-Time Trading Expert Advisor

Article MQL5 articles

Summary

The article describes design work on an Expert Advisor that manages orders, positions, and stop levels through chart objects. A central problem is that trade-server replies can be delayed, so the interface may alternately show an order as present or absent. This uncertainty is especially troublesome when a position command’s outcome is unclear, and can prompt incorrect user actions during volatile periods.

The author’s approach is to improve real-time speed and reliability through code reuse, object-oriented encapsulation, and fewer unnecessary operations. Specific changes include replacing a frequently used naming function with a macro, adjusting the corresponding parser, and refining how chart objects and mouse input are handled. The broader plan is to leave the EA focused on order management while shifting other work away from it. These are incremental implementation changes; the article offers no benchmark results and acknowledges that the safeguards described are imperfect. The order interface is still being developed across later installments.

Key ideas

  • Delayed server replies can make an EA’s chart-based view of orders and positions unreliable.
  • The author treats speed and robustness as joint requirements for real-time order handling.
  • Encapsulation and reuse are proposed to make the evolving system more dependable.
  • The installment changes object-name construction, parsing, and handling to reduce work and improve consistency.
  • The solution remains in development, and the article reports no measured performance improvement.

Tags

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