Advertisement IC Markets

MT4 processes orders one at a time

Discuss 1-minute to 15-minute price action setups, fading intraday momentum, key support/resistance zones, and proven short-term trading methodologies.
Post Reply
Shadow Trader
Posts: 5438
Joined: Wed Sep 09, 2026 5:19 pm

MT4 processes orders one at a time

Post by Shadow Trader »

MetaTrader 4 handles trading operations in a single trade thread per terminal. If two EAs on the same terminal send orders at the same moment, one waits for the other. If an order is waiting on the server, a second one can fail with "trade context busy" (error 146).

For manual traders that rarely matters. For anyone running multiple strategies on one terminal, especially ones that fire at news time or at the open of a bar, it can mean delayed or missed entries.

Several ways around it exist. Running separate terminals for each strategy gives each its own thread. Adding a random delay of a few milliseconds avoids exact collisions. Checking the busy flag before sending and retrying a few times also helps, as long as the logic doesn't chase a price that has moved on.

Even a single EA that opens a basket of orders in a loop can run into it, because each order has to wait for confirmation before the next one goes out. A basket of five trades can take two seconds to complete.

MT5 improved the situation with more flexible handling, but the principle that trade requests are queued still applies.

Another quirk is that the order of arrival isn't always the order of processing when several terminals connect to the same account. Two terminals sending orders at the same moment can have them processed in either sequence, which matters for strategies that depend on one order being in place before the next.

Keeping a single terminal responsible for all trading on an account removes the ambiguity.

Has "trade context busy" ever cost an entry during a fast market?
Recommended broker for automated trading & scalping IC Markets
Amanhasnoname
Posts: 1506
Joined: Fri Oct 30, 2026 9:45 am

Re: MT4 processes orders one at a time

Post by Amanhasnoname »

Yes, on a CPI release a while back when I was running three EAs on one MT4 terminal. Two of them were set to trade the same release on different pairs, and the second one got the trade context busy error, retried a few times and finally sent its order about a second and a half late. By then the move on that pair was mostly done and it filled near the top.

I didn't understand what had happened until I read through the journal tab and saw the error codes stacked one after another. Before that, I'd been blaming the broker's execution for that pair specifically.

The fix was splitting them across separate terminals, one per strategy, each with its own data folder. It uses a bit more memory on the VPS but the collisions stopped completely. I also changed the retry logic so that if the order can't go out within half a second, the EA gives up on that signal instead of chasing a price that has already moved.
Post Reply