Skip to content
All library documents

One-Cancels-Other Order Management for Breakout Trades

Article MQL5 code base

Summary

The document explains a small order-management helper for a breakout setup with pending orders on both sides of a channel. The trader places the orders manually; the script monitors orders for the chart's symbol and, once one is triggered, deletes all remaining pending orders for that symbol. It does not create orders or manage open positions.

The helper is intended to remove the need to watch for execution and cancel the opposite order by hand. It assumes there are no open positions for the symbol and exits when there are no pending orders. The description gives no testing evidence or details about handling partial fills, simultaneous triggers, or other symbols, so its behavior is limited to the stated symbol-level cancellation task.

Key ideas

  • The helper cancels remaining pending orders for the chart's symbol after one order is triggered.
  • The trader must place the orders before using the script.
  • It does not create orders or manage open positions.
  • It exits when no pending orders exist and assumes there are no open positions for the symbol.
  • Its described scope is symbol-level cancellation, with no evidence about edge cases or performance.

Tags

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