Ballast OCO Orders
- Utilities
- Version: 1.0
- Activations: 10
One-cancels-other for MT5: when one pending order fills, the others are deleted at once. One-click straddle with stop, target, expiry and a risk-based lot.
MetaTrader 5 has no built-in OCO. Place a buy stop above and a sell stop below before the news, one of them fills, and the other one is still waiting to open a second trade against you. Ballast OCO Orders deletes it for you.
What it does
- OCO for any pending orders — buy/sell stop, buy/sell limit, stop-limit. Placed by hand, from the one-click button, or by another EA. When one order of a group fills (fully or partly), every other order of that group is deleted.
- Two ways to group orders: all pending orders of a symbol form one group (simplest), or only orders whose comment starts with OCO and is the same (OCO1, OCO2 ...), so you can keep other pending orders untouched.
- One-click straddle — buy stop above and sell stop below the price, in points or as a multiple of ATR, with stop-loss, target (as a multiple of the stop) and a lot size that risks your chosen % of balance.
- Expiry — the straddle is deleted after N minutes if nothing filled (broker expiry when available, otherwise the EA deletes it).
- One button deletes all watched pending orders.
- Works on one symbol or the whole account, with an optional magic number filter.
Tested (1 year, 4 symbols: EURUSD, Gold, US30, Bitcoin)
The test placed groups of 2–4 random pending orders (and straddles through the button) and kept its own record of every order.
- 4,474 orders placed, 1,979 fills, 2,394 other orders deleted after a fill (both grouping modes, 8 runs).
- 0 orders deleted without a fill in their group, 0 orders left standing longer than 2 seconds after a fill, 0 orders outside a group touched.
- 8 symbol/timeframe/deposit validation combinations without errors.
Notes
- The EA must be running when the order fills (keep the terminal on, or use a VPS). If two orders of a group fill on the same price jump, both positions stay open: no tool can stop that.
- Partial fills count as a fill: the rest of the group is deleted, the partly filled order keeps working.
- For news trading on a prop-firm account, check your firm's rules first; Ballast News Shield can pause trading around news instead.
Inputs
- Watch — this chart's symbol
- Group — all pending orders of a symbol
- Magic number filter — -1 = all
- Straddle distances in — ATR(14) multiple
- Entry / stop distance — 1.0 / 1.0
- Target (× stop) — 2.0
- Lot — 1% risk of balance
- Expiry (minutes) — 240
