Ballast OCO Orders MT4
- Утилиты
- Версия: 1.0
- Активации: 10
One-cancels-other for MT4: when one pending order fills, the others are deleted at once. One-click straddle with stop, target, expiry and a risk-based lot.
MetaTrader 4 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. Placed by hand, from the one-click button, or by another EA. When one order of a group fills, 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 on MT4 (every tick; EURUSD 1 year, Gold 7 months)
The test placed groups of 2–4 random pending orders (and straddles through the button) and kept its own record of every order.
- 1,757 orders placed, 672 fills, 1,040 other orders deleted after a fill (both grouping modes).
- 0 orders deleted without a fill in their group, 0 orders left standing longer than 2 seconds after a fill (while the market was open), 0 orders outside a group touched.
- A fill during the broker's daily break or before a weekend is handled the moment the market reopens.
- 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 trades stay open: no tool can stop that.
- Expiry: the broker's own expiry time is used; if the broker refuses expiry times, the EA deletes the straddle itself when the time is up.
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
- This is the MT4 version. The MT5 version is a separate product on the Market.
