Advertisement IC Markets

Error 146 and the EA collision nobody plans for

Compare ECN/Raw spread brokers, analyze execution speeds, report slippage, and evaluate commission structures for high-frequency traders.
Post Reply
Amanhasnoname
Posts: 1506
Joined: Fri Oct 30, 2026 9:45 am

Error 146 and the EA collision nobody plans for

Post by Amanhasnoname »

MT4 allows only one trade operation at a time per terminal. When two experts try to send orders within the same moment, one gets error 146, trade context busy. On a single-EA setup that is rare. With several scalping EAs on different charts, it becomes routine.

The failure is quiet. One EA's entry simply does not happen, or worse, a stop modification fails while the other EA is busy sending a market order. Position management then runs on stale levels.

Fixes exist at several levels. Code can check whether the trade context is free before sending, wait a random few tens of milliseconds, and retry a limited number of times. A shared lock using a global variable lets multiple EAs queue politely. Or a single master EA can route all orders.

MT5 handles this differently, since order requests are asynchronous and queued, but it has its own failure modes such as request limits.

Searching the logs for 146 shows how often collisions happen. Even a handful per week deserves a fix.

How are order collisions handled between EAs sharing one terminal?
Recommended broker for automated trading & scalping IC Markets
Post Reply