TROUBLESHOOTING · UPDATED OCTOBER 13, 2026

MT5 Error Codes: What They Mean and How to Fix Them

Error 130, 131, 134, 136, "Market Buy Error", "Trade Context Busy". Each one has a concrete cause and a concrete fix. What they actually mean, why automated orders hit them more than manual trading, and a 30-second diagnostic at the end.

BBenjamin SF · Founder Published Oct 13, 2026 Read 9 min Updated 2026-10-13

Jump to: Where the error comes from · The codes you will actually see · "Market Buy Error" (retracement) · Error 130 (invalid stops) · 136 and the double-instance pattern · 30-second diagnostic

01

Where the error comes from: terminal or broker

Two different systems reject your order. Codes 100–149 come from the MT5 terminal itself (invalid stops, busy context, connection). Codes 10015 and up, and text rejections like "trade disabled" or "invalid account", come from your broker's trade server. The fix for each side is different: the first is configuration, the second is a phone call.

An automated setup (EA, bridge, alert-driven execution) hits these in volume because it never waits for you to notice. A manual trader gets one ugly message a week; an automated account gets ten a day. That is why reading the code matters more here than anywhere else in MT5.

02

The codes you will actually see

Ninety percent of order failures in automated accounts fall into five codes. Here is what each one really means and the fix that works:

130 — Invalid stops
SL or TP closer to price than your broker's Stop Level allows, or a spread spike moved the effective stop to the wrong side. Fix: keep stops at or above the broker minimum; with auto-breakeven, keep the trigger far enough from entry. Full section below.
131 — Market re-quote
The price moved between the request and the execution. The order is not lost, the broker's price changed. Fix: nothing to fix — a well-built EA retries once after 131. Persistent 131s at news are an entry-timing problem, not an MT5 problem.
134 — Request rejected
Broker-level rejection: insufficient margin, swap rules, account mode mismatch (hedging order on a netting account), or trading paused. Fix: check free margin and account mode; if it says trade disabled, ask the broker what it means for your account.
136 — No changes / Trade context busy
The terminal was busy with another operation when the request arrived. Fix: let it settle and retry. If it persists for minutes, check the double-instance pattern before blaming the EA.
146 / 148 / 149 — Connection
146 server not found (server list outdated or terminal never logged in), 148 reconnecting, 149 connection lost. Fix: verify the terminal is online and connected to the right server; on cloud terminals, a full reboot usually clears a stale server list.

Also worth knowing: 4001 (duplicate position / two instances fighting) and 10015 (duplicate order from the broker's side) almost always share the same root cause — two processes writing to the same account.

03

"Market Buy Error" (retracement): why your buy failed

The classic message of a rejected market order. The broker tried to fill your buy and the market moved enough that the fill would be worse than your order's tolerance. Four causes, in order of frequency:

1. Spread widened at the moment of entry. A news release can multiply the spread several times in one second; a market order sized for a normal spread gets rejected. The fix that actually works for automated trading is a short blackout around high-impact news, not a wider tolerance.

2. Stops below the broker's Stop Level. If the SL/TP distance is under the minimum, the broker rejects the whole order, not just the stops. Check the Stop Level for your symbol in Market Watch before assuming a bug.

3. Symbol filter of your account type. Some account types (swap-free, cent, region-limited) do not accept all symbols or order types. "Invalid account" on one symbol but not another is the fingerprint.

4. Weekend or holiday freeze. Markets close Friday; pending orders resting over the weekend can fail on the Monday gap. Keep no open-risk logic that assumes the market is always reachable.

04

Error 130: the stop is too close (and the breakeven trap)

Invalid stops is the most common failure in automation because spreads are a moving target: what was a 12-point stop at 10:00 is a 6-point stop at the news print. Three situations produce it in practice:

The SL/TP was always under the broker minimum. Easy: measure it once, set your template above the Stop Level with margin for spread, and never below it.

Auto-breakeven moving the stop into the spread. This is the subtler one. When a breakeven trigger fires with the spread wider than usual, the new stop can land on the other side of the price and the broker rejects the modify. If your account shows random 130s right after a breakeven event, that is the cause — cap the breakeven offset relative to the current spread instead of using a fixed point value.

Partial close + re-modify race. Closing part of a position and re-modifying the remainder in the same tick can collide with the broker's order-book state. Retrying the modify once, a few seconds later, is the standard cure.

The same discipline applies to your risk layer: see the MT5 risk management checklist for keeping stops and lot sizing inside the broker's rules.

05

Error 136, 4001 and the double-instance pattern

"Trade context busy" (136) means the terminal had its hands full. One request arriving while another is in flight gets 136; a retry a few seconds later goes through. A well-behaved execution layer expects this and retries.

The version that does not go away has one specific cause, and it is more common than you'd think: two terminals running the same account. An EA on your local machine plus an EA on a cloud terminal, both attached to the same broker account, take turns holding the trade context. The symptoms are 136 in bursts and 4001 (duplicate position) when both sides try to open or close at the same moment.

The fix is not software: one account, one terminal, one EA. Close or log out the second terminal, and if positions were left duplicated, close the extras manually before re-enabling automation. A related quiet culprit: closing the chart window can silently detach an EA — if your signals stopped being executed but the terminal shows no error at all, check that the EA is still attached to a live chart.

06

Diagnose any MT5 error in 30 seconds

1. Open the History tab. Every rejected order is listed with its code in the reason column. That number, not the popup, is your diagnosis. Match it against section 02.

2. Check the Journal tab. Connection events (146/148/149), server renames and reconnections are logged there, not in History. If the Journal says "reconnecting" in a loop, the terminal lost the server — it is not your strategy.

3. If you run SignalForge: read /execution. Every signal shows its exact outcome and the broker's rejection code, so you skip the terminal entirely: which signal failed, which code, at what time. That is the fastest way to separate "my alert is wrong" from "the broker said no".

4. Decide whose problem it is. Codes 100–149: your configuration (stops, retries, server list). 10015 and up, or "trade disabled" / "invalid account": the broker's. Send them the exact code and timestamp — support teams move twice as fast with a code than with "my trades don't open".

Setting everything up from scratch? Start with the TradingView to MT5 connection guide, which includes the demo-test step that catches most of these before they cost you a real fill.

Frequently asked questions

What does "Market Buy Error" mean in MT5?

The broker rejected the buy order at execution time, usually because the spread widened beyond the broker's stop level (often at news), or the stop/TP distance was below the broker minimum. Check the spread before entry, keep stops at or above Stop Level, and avoid entering on high-impact news.

What does MT5 error 130 (Invalid stops) mean?

Your stop loss or take profit is closer to the current price than your broker's Stop Level allows, or a spread spike moved the effective stop to the wrong side. Increase the stop distance or move the level outside the broker minimum.

Why does my EA fail to open trades during news?

During high-impact news the spread widens several times and fills slip, so the broker rejects the order (retracement, re-quote, invalid stops). A news filter or a short blackout around scheduled events is the standard fix for automated setups.

Is MT5 error 136 (No changes) a bug in my EA?

Usually no. It means the terminal was busy with another operation when the request arrived. It clears after the terminal settles. If it persists, check that two terminals or two EA instances are not running on the same account.

Can SignalForge AI fix MT5 order errors automatically?

It retries transient rejections with a short backoff, records the exact error code for every signal and shows it in the /execution panel, so you can diagnose without reading terminal logs. Rejections that come from the broker (invalid account, trade disabled) must be fixed on the broker side.

Written by Benjamin SF, founder of SignalForge. Error codes and behaviour described here come from live operation of automated MT5 accounts across multiple brokers; MetaQuotes' official error list is the final reference for each code.

Stop guessing, start diagnosing

Every rejected signal, with its exact broker code, in one place. Test the whole pipeline on demo with the free 14-day trial.

Start the free trial Read the docs

SignalForge AI is an order-execution tool. Error behaviour depends on your broker's rules and your configuration; past behaviour does not guarantee future results. Trading involves substantial risk of loss.