Every EA trader eventually opens the Experts tab and finds a line like OrderSend error 130 or failed market buy 0.10 EURUSD [Unsupported filling mode]. The trade didn’t happen, the EA carried on, and you are left guessing whether the problem is your code, your broker or your infrastructure.
The error code tells you which. MetaTrader’s trade errors fall into three groups that call for very different responses: problems with the order itself, problems with the account or broker, and problems with timing and connectivity. Only the last group is something a better VPS can fix, and knowing that saves you from paying for infrastructure to fix a coding bug, or rewriting code to fix a network problem.
📊 Key Stat: Of the common MetaTrader trade errors, only a handful (no connection, timeout, requote, off quotes) are sensitive to network latency. The rest reproduce identically on a laptop, a VPS or a dedicated server, so rule them out before blaming infrastructure.
Where to Find the Code
Trade errors show up in two places:
- The Experts tab in the Toolbox (Terminal) window, where your EA prints what it tried and what came back
- The Journal tab, where the terminal itself logs order requests and server responses
In MT4 code, the number comes from GetLastError() after a failed OrderSend, OrderModify or OrderClose. In MT5, it is the retcode field of the MqlTradeResult structure (codes in the 10000 range), plus GetLastError() for client-side runtime errors. If your EA doesn’t print these values, ask the developer to add it. An EA that fails silently can’t be diagnosed.
Group 1: The Order Itself Is Invalid
These errors mean the broker’s server rejected the request as written. Resending the same request will fail the same way.
MT4 130 / MT5 10016: Invalid Stops
The most common trade error in MetaTrader. The stop loss or take profit is:
- too close to the current price. Every symbol has a minimum stop distance (
SYMBOL_TRADE_STOPS_LEVEL, orMODE_STOPLEVELin MT4) that varies by broker and symbol. - on the wrong side of price, such as a buy stop loss above the entry
- calculated from the wrong price. Buys close at the Bid, so their SL/TP are checked against the Bid, and sells against the Ask.
It also shows up when an EA written for 4-digit quotes runs on a 5-digit broker. A “20 pip” stop becomes 2 pips and falls inside the stops level.
Fix: Read the stops level at runtime and enforce a minimum distance in code. This is not a VPS problem.
MT4 131 / MT5 10014: Invalid Volume
The lot size is below the symbol’s minimum, above its maximum, or not a multiple of its step. Moving between brokers causes this constantly. One broker allows 0.01 steps, another only 0.1 on some indices.
Fix: Round lots to SYMBOL_VOLUME_STEP and clamp them between SYMBOL_VOLUME_MIN and SYMBOL_VOLUME_MAX.
MT4 129 / MT5 10015: Invalid Price
The price sent with the order is not valid. Often the EA is using stale prices without calling RefreshRates() (MT4), or it is sending an unnormalised price with too many decimals.
Fix: Refresh prices immediately before sending and normalise to the symbol’s digits.
MT5 10030: Unsupported Filling Mode
This error is specific to MT5 and catches almost everyone who moves an EA between brokers. Each symbol allows certain order filling policies (Fill or Kill, Immediate or Cancel, Return), and they vary by broker and by execution type. An EA that hard-codes ORDER_FILLING_FOK works at one broker and fails every trade at the next.
Fix: Read SYMBOL_FILLING_MODE and pick a supported policy at runtime. See our market vs instant vs exchange execution guide for why brokers differ.
⚠️ Warning: Group 1 errors often show up only after a broker change or a move from demo to live, because the symbol specifications are different. If an EA ran cleanly for months and started throwing 130s or 10030s the day you switched accounts, compare the symbol specifications (right-click the symbol in Market Watch, then Specification) before you touch anything else. Our guide to migrating an EA between brokers has the full checklist.
Group 2: The Account or Broker Won’t Accept It
The order may be valid, but something about the account or market state blocks it.
MT4 134 / MT5 10019: Not Enough Money
Free margin is insufficient for the requested volume. Common with grid and martingale systems as positions stack up. Our grid and martingale VPS guide covers the risk side.
Fix: Check free margin with AccountFreeMarginCheck (MT4) or OrderCalcMargin (MT5) before sending.
MT4 132 / MT5 10018: Market Closed
The symbol is outside its trading session. Watch for this on indices and metals with daily breaks, and around the weekend rollover. See our weekend gap and Sunday rollover guide.
MT4 133 / MT5 10017: Trade Disabled
Trading is disabled for this symbol or account. This often means the terminal is logged in with the investor (read-only) password instead of the master password. It also happens with close-only symbols and on expired demo accounts.
MT4 4109 / MT5 10027: AutoTrading Disabled
MT4’s 4109 means trading isn’t allowed for the EA. Either the global AutoTrading button is off, or “Allow live trading” is unticked in the EA’s properties. MT5’s 10027 is the retcode for AutoTrading being disabled in the client terminal.
Fix: Turn AutoTrading on and check the EA’s Common tab. This one often appears after a terminal restart if the terminal wasn’t set to keep AutoTrading enabled, which is why it matters on a VPS that restarts for updates. Our MT4 automatic startup guide covers the settings.
MT4 148: Too Many Orders
The broker’s limit on open and pending orders was reached. Check the account’s limit with your broker.
Group 3: Timing and Connectivity
These are the errors infrastructure can influence. They happen when the request is valid but the market moved or the connection faltered between request and fill.
MT4 138 / MT5 10004: Requote
The price moved between the request and the server processing it, and the broker offered a new price instead of filling. You see this on instant-execution accounts during fast markets.
VPS relevance: Real. The longer the round trip from terminal to server, the more the price can move while your order travels. A colocated VPS shortens that window. Allowing a sensible slippage (deviation) value in the EA also helps. Our slippage and requotes guide quantifies the effect.
MT4 135 / 136: Price Changed / Off Quotes
135 means the price changed. 136 (off quotes) means the broker had no price to offer at that moment. It’s common in the first seconds after a news release or at the market open.
VPS relevance: Partial. Lower latency reduces how often your request arrives on a stale price. But if the broker has no liquidity to quote, no VPS will conjure a price. See our news trading execution guide.
MT4 146: Trade Context Busy
MT4 allows one trade operation at a time per terminal. If two EAs in the same terminal try to trade at the same instant, one gets 146.
VPS relevance: Indirect. The real fix is code-side: retry after a short wait, or use a mutex such as a global variable lock. Running high-frequency EAs in separate terminals avoids the contention entirely. A VPS with enough RAM for multiple terminals makes that practical. MT5 does not have the same single-context limitation.
MT4 6, 128, 137 / MT5 10031: No Connection, Timeout, Broker Busy
MT4 6 means no connection to the trade server. 128 means the trade request timed out. 137 means the broker is busy. MT5’s 10031 is “no connection with the trade server.”
VPS relevance: Direct. These errors cluster on home connections, where Wi-Fi drops, router resets and congestion interrupt the terminal’s link to the broker. A datacenter-hosted VPS on redundant networking all but eliminates the client side of these.
⚠️ Warning: Error 128 (timeout) is dangerous because the outcome is unknown. The order may have been filled even though your EA got no confirmation. An EA that simply resends after a timeout can open a duplicate position. Well-written EAs check open positions before retrying. Check that yours does.
🚀 Try FXVPS for $2.99. If your logs are full of Group 3 errors, test a 7-day Core VPS near your broker’s server and compare a week of logs.
A Quick Triage Routine
When you find a trade error in the logs:
- Note the code and timestamp. Check the Journal for the same moment. Was the terminal connected?
- Classify it. Group 1 needs a code or settings fix. Group 2 needs an account or state fix. Group 3 points to a connectivity or timing issue.
- Check for patterns. Errors clustered around news, market open or a specific hour tell a different story from errors that appear randomly.
- For Group 3 errors, measure. Check the ping to your broker’s server from where the terminal runs. Our latency, jitter and packet loss guide explains what good looks like.
✅ Best Practice: Keep a copy of the Experts and Journal logs before you restart anything. MetaTrader writes them to dated files in the data folder (File → Open Data Folder, then the
logsandMQL4/LogsorMQL5/Logssubfolders). A restart doesn’t delete them, but a busy week can bury the entry you need.
Frequently Asked Questions
Will a VPS fix error 130?
No. Error 130 means the stops are invalid for the symbol’s rules, and that happens identically on any machine. It is fixed in the EA’s logic or settings.
Why does my EA work on demo but throw errors on live?
Demo and live servers often have different symbol specifications: stops levels, volume steps, filling modes and even symbol names with suffixes. Compare the specifications side by side.
Is error 146 a sign my VPS is too slow?
Not usually. It means two operations collided in the same MT4 terminal. It is a concurrency issue in the EAs, fixed with retries or by separating the EAs into different terminals.
What is the single most useful thing I can do for error handling?
Make sure your EA logs the error code, symbol, price, SL/TP and volume on every failure. With that line in the log, almost every error is diagnosable in minutes.
Related Reading
- MT4/MT5 “No Connection” Errors on a VPS. When the terminal loses the broker entirely.
- Slippage, Requotes and VPS Latency. The numbers behind Group 3 errors.
- Migrating an EA Between Brokers. Avoid the Group 1 errors that follow a broker change.
- Why Your Backtest Doesn’t Match Live Results. Errors that never appear in the Strategy Tester.