Skip to content
All library documents

Using Ghost Chart Labels for Faster Pending Order and Stop-Level Editing

Article MQL5 articles

Summary

This article extends a MetaTrader 5 Expert Advisor interface for editing pending orders and position levels on a chart. Its central change is to let mouse movement update a local preview rather than send every intermediate price adjustment to the trade server. The server is notified when the user commits the desired change, reducing the delay caused by processing a sequence of tick-sized edits.

The implementation creates paired ghost and real chart objects. The ghost objects provide a visual preview of the proposed level, while distinct names and event values prevent them from capturing the real controls' events. Mouse handling is consolidated so the same event pathway supports placing pending orders and moving existing trade objects. The article also describes routing edits to the relevant take-profit, stop-loss, or pending-price modification function, including shifting associated levels when the pending entry moves.

This is an interface and execution workflow tutorial, not a trading strategy or performance study. The preview improves interaction speed, but the article does not provide latency measurements or analyze broker-side rejection and synchronization risks.

Key ideas

  • Repeatedly sending every mouse adjustment to the server can make chart-based level editing slow.
  • Ghost chart objects can preview proposed prices while the real objects remain the committed controls.
  • Distinct object naming and event identifiers keep preview objects from handling trade actions.
  • A shared mouse-movement pathway can support both pending-order placement and editing existing levels.
  • The article explains interface mechanics but provides no trading-performance evidence.

Tags

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