MT5 return codes: why your order was refused
Updated on
The short answer
When an order is rejected, MT5 shows a five-digit number starting with 100. That code comes from your broker’s server and not from the platform, which means it describes a decision taken there. 10009 is success. The four most frequent refusals are 10016, a stop or target on the wrong side or too close to price, 10019, insufficient funds, 10014, a size that does not respect the lot step, and 10017, trading disabled on that instrument or on that account. The first three are fixed by changing the order, the fourth is not.
What a return code is
It is not an error message from your software, but your broker’s server answering a precise request. That is why it is reliable: it says what was refused, and by whom.
Two codes mean everything went well: 10009 for a filled order, and 10008 for a pending order correctly placed. All the others describe either a refusal or a particular state.
One useful distinction before the detail: some refusals are about your order, and are fixed by changing it. Others are about your account or the instrument, and no change to the order will make any difference. Confusing the two wastes a lot of time.
The refusals that come from your order
10016, invalid stops, is by far the most common. It means the stop or the target is on the wrong side of price, or too close to it. That “too close” is not a judgement call: your broker publishes a minimum distance, visible in the contract specification under a heading such as “stops level”, expressed in points. Below that distance the server refuses, whatever the quality of your analysis. On a volatile instrument it is also a sign that a stop is being placed inside the noise.
10015, invalid price, is the same problem applied to the entry price of a pending order: either it is on the wrong side of the market for the order type chosen, or it is too close to the current price.
10014, invalid volume, means the requested size does not respect the lot step, or falls below the minimum, or exceeds the maximum for that instrument. Those three numbers are in the contract specification too. It is exactly the block described on our page about position size by instrument.
10019, insufficient funds, says the available margin does not cover the requested position. On a modest account it happens mostly on instruments with capped leverage, such as Bitcoin in Europe, and on the last leg of a plan with several targets, once the earlier ones have tied up the margin.
10030, unsupported filling mode, is more technical: the execution type requested is not accepted by that instrument. It is a setting, not a mistake on your part.
The refusals that do not come from your order
10017, trading disabled, is the most misleading, because the chart displays normally and prices tick. It says trading is disabled without saying on what: it can be that instrument for your account type, or your whole account if it is read-only. The first case is the duplicates one, covered on our page about symbol suffixes and duplicates. The second is the investor password.
10018, market closed, deliberately has its own code. So if you see 10017 outside market hours, the cause is not the closure. It is a common confusion, and many loose translations keep it alive by putting both causes in the same message.
10026, automated trading disabled by the broker, means your broker refuses orders sent by a program on that account, even though you can trade by hand in MT5. It is not a setting on your side and there is nothing to fix: either you place the order manually, or you need an account that allows it. It is also a common rule on prop firm accounts.
10027 is its cousin, but refers to the client terminal. You should never meet it through a properly configured tool.
10028, account locked, and 10032, operation reserved for demo accounts, belong to the same family: it is the account answering, not the order.
The circumstantial refusals
10004 and 10020 signal that the price changed while the order was being sent. They are normal in a fast market, notably around an economic release, as explained on our page about the economic calendar. Simply send again.
10021, no quotes available, and 10031, connection to the trade server lost, describe a link or feed problem, not your order.
10024, too many requests, is a server safeguard against sending in bursts.
The codes at a glance
10008and10009: order accepted, nothing to do;10004,10020,10021,10024,10031: circumstantial, try again;10014,10015,10016,10019,10030: your order, to be corrected;10017,10026,10027,10028,10032: your account or the instrument, nothing to correct in the order.
What AlphaGPT does
A refused order does not show a number but the cause, written in your language. And when the refusal comes from an instrument disabled on your account, the cause is made precise, distinguishing the instrument from the account, and then the variants of the same instrument genuinely tradable for you are offered in one click, provided it really is the same instrument.
The rest depends on your broker and your account, and no tool can get around it: what it can do is tell you which of the two is blocking you.
Trading carries a risk of capital loss.