OCO does not exist on some platforms, and the workaround breaks
Posted: Fri Oct 30, 2026 11:54 am
OCO does not exist on some platforms, and the workaround breaks
One-cancels-other orders are standard on many platforms. On MetaTrader 4 and 5, there is no native OCO for pending orders. Traders build it with scripts or EAs.
The script watches one order. When it fills, the script cancels the other. In a calm market, it works. In a fast market, a gap opens in the logic. Both orders can fill before the script reacts, especially when the platform is under load.
The same risk exists if the platform or the VPS disconnects at the wrong moment. The script stops running, and the unwanted order stays active.
A server-side OCO, offered by some brokers or platforms, avoids the problem because the matching happens at the broker.
When a strategy relies on OCO-style behaviour, testing in live conditions with small size is worthwhile. Demo may not show the gap.
Is the OCO logic in use handled on the server or on the client, and has anyone tested what happens during a disconnect?
One-cancels-other orders are standard on many platforms. On MetaTrader 4 and 5, there is no native OCO for pending orders. Traders build it with scripts or EAs.
The script watches one order. When it fills, the script cancels the other. In a calm market, it works. In a fast market, a gap opens in the logic. Both orders can fill before the script reacts, especially when the platform is under load.
The same risk exists if the platform or the VPS disconnects at the wrong moment. The script stops running, and the unwanted order stays active.
A server-side OCO, offered by some brokers or platforms, avoids the problem because the matching happens at the broker.
When a strategy relies on OCO-style behaviour, testing in live conditions with small size is worthwhile. Demo may not show the gap.
Is the OCO logic in use handled on the server or on the client, and has anyone tested what happens during a disconnect?