MetaTrader error codes explained

What codes 10016, 10027, 10014, 10018, 10030, 4014, 1009 and others mean, and what to do for each one.

4 min read

When MetaTrader or your broker refuses an order, it returns a code. ProTradingLabs translates it and tells you what to do.

Where to find the code

  • On the Signals page, open the signal: the Failure cause section gives the cause, the action to take and the technical code.
  • In the ProTradingEA panel in MetaTrader, section DERNIERS TRADES REFUSÉS (last refused trades): the last three refusals, with the time, the symbol and the reason in plain words. The number only shows there for a code that is not in the list below.

The most common codes

CodeWhat it meansWhat to do
10027Algo Trading is off in MetaTrader, or the account does not allow trading (for example when logged in with the investor password).Turn on the Algo Trading button at the top of MetaTrader (it must be green). Also check that Allow algorithmic trading is ticked in Tools > Options > Expert Advisors, and Allow Algo Trading in the Common tab of the EA's properties (F7).
10016Invalid stops: the broker refuses the Stop Loss or Take Profit, often because it is too close to the current price.The Stop Loss and Take Profit must respect the broker's minimum distance on this symbol. If you send your own signals, check the minimum distance in your broker's symbol specification.
10014Invalid volume: the lot does not match the broker's minimum, maximum or lot step.Check the symbol's lot limits with your broker.
10019Not enough margin or funds.The account does not have enough free margin for this position. Check the account's free margin and the configured risk.
10018Market closed.Nothing to do. A refused opening is not retried; a close, break-even or stop is (see below).
10017The broker disabled trading on this symbol or account.Check with your broker. Some brokers list several variants of a symbol, and only one of them is tradable.
10044The broker only accepts closing orders on this symbol.Nothing to do on the EA side.
10021No quotes for this symbol.Wait for prices to come back, or check that the symbol is available with your broker.
10031MetaTrader is not connected to the broker.See My MetaTrader account is disconnected. A refused close, break-even or stop is retried (see below).
10030Filling mode refused: the broker does not accept this execution type on this symbol.Contact support with the symbol and your broker's name.

Refused close, break-even or stop: the EA retries

Since version 1.6.3, ProTradingEA retries by itself a close, break-even or stop move refused for a temporary reason: market closed (10018), MetaTrader not connected (10031), Algo Trading off (10027), requote or price changed (10004, 10020), timeout (10012), no quotes (10021), too many requests (10024)… It retries after 1 s, 5 s and 15 s, then every minute. While the symbol's session is closed, it sends nothing. It stops when the order goes through, when the position is gone, on a final refusal, or after 7 days.

During these attempts, the signals page shows Client received; the final result shows afterwards. If a newer signal arrives on the same position, the waiting break-even or stop is dropped: Replaced by a newer command on the same position.

A refused opening, on the other hand, is never retried. With an older version of ProTradingEA, a refused close is not retried either: close the position yourself in MetaTrader.

Lot too small for the broker's minimum

If the cause shown is Volume is below the allowed minimum, the lot computed from your risk is smaller than the broker's minimum lot. The EA refuses the trade rather than rounding it up to the minimum: that would raise your risk without your consent.

Risk is set in your configuration (Default Risk and Risks per Symbol). It is up to you to decide whether to change it.

Error 4014: WebRequest not allowed

This code does not come from the broker: MetaTrader stops the EA from reaching ProTradingLabs. The number only appears in the Experts tab; elsewhere you see ProTradingLabs URL is missing from MT5’s allowed WebRequest list on the signals page, or « MetaTrader interdit à l'EA de joindre ProTradingLabs » (MetaTrader prevents the EA from reaching ProTradingLabs) in the EA panel. Add https://api.protradinglabs.com and http://ws.protradinglabs.com in Tools > Options > Expert Advisors > Allow WebRequest for listed URL, then restart the EA. Details in Connect MetaTrader 5 to your journal for ProTradingData, and in ProTradingConnector troubleshooting for ProTradingEA.

HTTP error 1009: secure connection refused

This code comes neither from the broker nor from our servers: MetaTrader refuses the secure connection to ProTradingLabs, often on a freshly installed Windows VPS that is missing a certificate. The EA panel shows « Le serveur ProTradingLabs a renvoyé une erreur (HTTP 1009) ». One PowerShell command fixes it: see HTTP error 1009.

A code that is not in this list? Note it with the symbol and the time, then contact support. If you can, attach MetaTrader's Experts tab.

Did this article help?
Can't find the answer?Email support, or sign in to ask the help assistant.