Back to guides
MT5 Error 4756 Trade Request Sending Failed: How to Find the Cause

MT5 Error 4756 Trade Request Sending Failed: How to Find the Cause

Benjamin F., Co-founder7 min read

MT5 error 4756 is ERR_TRADE_SEND_FAILED, which MetaQuotes describes as "Trade request sending failed." An EA receives it when an order it tried to send did not go through, but the error only tells you that the order failed, not why. The reason is stored in a second, five-digit code called the trade server return code, such as 10016 for invalid stops or 10019 for not enough money, and that second code is the one you need to find.

So treat 4756 as a pointer rather than a diagnosis. Once you find the return code that came with it, the fix is usually obvious, and this guide shows where to look and what the common codes mean.

Where to find the real cause of error 4756#

When an EA calls OrderSend, MT5 fills in an MqlTradeResult structure whose retcode field holds a five-digit return code and whose comment field often holds the broker's own text. EAs built on the standard CTrade class read the same values through ResultRetcode() and ResultRetcodeDescription(), and a well-written EA prints both whenever an order fails.

Open View → Toolbox → Experts and find the line where the order failed, then check the Journal tab for the same second, where the terminal keeps its own record of the request. One of the two will carry a code of 10004 or above, and that is the code to look up in MetaQuotes' trade server return codes. If the EA prints only 4756 and nothing else, the information is lost for that trade. Without the return code and comment every failure looks identical, so it is worth asking the developer to log ResultRetcode() and ResultComment() on every failure.

The return codes behind most 4756 errors#

Return codeConstantWhat to fix
10013INVALIDA field in the request is wrong, so check the symbol, order type and expiry
10014INVALID_VOLUMEThe lot size breaks the symbol's minimum, maximum or step. See invalid volume
10015INVALID_PRICEThe price is off the tick size, stale, or on the wrong side for a pending order
10016INVALID_STOPSA stop loss or take profit is too close or on the wrong side. See error 10016
10017TRADE_DISABLEDTrading is disabled for this account or symbol
10018MARKET_CLOSEDThe symbol is outside its session. See market closed
10019NO_MONEYThere is not enough free margin. See error 10019
10021PRICE_OFFThere are no quotes to price the request
10027CLIENT_DISABLES_ATAlgo Trading is off. See EA not trading
10030INVALID_FILLThe order's filling type is not allowed for this symbol
10031CONNECTIONThere is no connection to the trade server

Every constant above carries the prefix TRADE_RETCODE_ in MQL5.

Unsupported filling mode (10030)#

Brokers allow different filling policies per symbol, typically some combination of Fill or Kill, Immediate or Cancel and Return, and a request that asks for a policy the symbol does not support fails with 10030, "Invalid order filling type." This catches EAs that hard-code a single policy and are then moved to a broker or symbol that uses another. The policy is set per symbol, so it can even appear when the same EA trades a different symbol at the same broker. The allowed policies appear in the symbol's specification and in SymbolInfoInteger(symbol, SYMBOL_FILLING_MODE), and the fix belongs in the EA's code or settings, which should choose a policy the symbol allows.

No quotes or no connection (10021 and 10031)#

10021 means the terminal has no current price for the symbol, which happens just after a symbol is added to Market Watch, during a feed outage and around session opens, while 10031 means the terminal has lost its connection to the broker's trade server. Check the connection status in the bottom right corner of MT5 and confirm that the symbol is showing live prices in Market Watch, and avoid resending the order repeatedly while either condition lasts.

Requotes and price changes (10004 and 10020)#

Requotes only happen on accounts that use instant or request execution, where each order carries a deviation, the maximum distance the fill price may move from the requested price. If the market moves further than that before the broker fills the order, the broker answers with a requote (10004) or a price change (10020) instead of a fill, which happens most often in fast markets and around news. On market execution accounts, which most ECN and prop firm accounts use, the deviation is ignored and orders fill at the best available price, so these two codes rarely appear.

The PineHook EA sends entries with a deviation of 10 points, the standard default in MT5's trade library, and does not resend an entry that gets requoted. A second attempt would fill at a price the alert never asked for. The failure is recorded on the alert's Signal Logs row with the broker's description beside the code. Closes work the other way round: the EA sends them with a very wide deviation, so that an exit never fails just because the price moved, and a close that fills more than 100 points away from the expected price is flagged with an Extreme volatility badge so you can see the slippage afterwards.

If you want control over the price an entry is allowed to fill at, PineHook gives you that through the alert rather than through the deviation. Adding the alert's price as marketprice together with a maxspread_pips or maxspread_pct limit refuses the entry when the price has moved too far from it, and the Signal Logs row shows the price PineHook saw next to your limit. Slippage protection explains the settings.

How PineHook turns 4756 into a readable reason#

Error 4756 is a good example of a code that tells you something failed without telling you what, which is exactly the kind of message PineHook avoids. When the broker refuses an order, the PineHook EA records the return code together with its description, in the form BUY failed: <description> (10016), on the alert's row in Signal Logs and in the Experts tab, so the cause is on screen without any lookup.

Many failures never reach the broker in the first place. Before sending an order, the EA checks the symbol's volume limits and minimum stop distance, and when an alert breaks one of them it refuses the order with a message that names the problem and the numbers involved, such as a lot size below the symbol's minimum, rather than letting the broker answer with a generic code. The full list of PineHook trade messages and fixes is in Trade errors, and you can create a PineHook account without payment details to see them on a demo account.

FAQ#

Is MT5 error 4756 the same as 10016?

No. 4756 means a request failed, while 10016 is one specific reason, invalid stops, and since a 4756 can come with 10016 or with any other return code, it cannot be fixed on its own.

Why does error 4756 happen on some symbols and not others?

Volume step, minimum stop distance, filling policy and trading sessions are all set per symbol, so a request that works on EURUSD can break the rules on gold or an index CFD at the same broker. Compare the failing symbol's specification with one that works.

MetaTrader is a trademark of MetaQuotes, and PineHook is an independent product that is not affiliated with, endorsed by, or sponsored by MetaQuotes. Leveraged trading carries a high risk of loss, so test any automated setup on a demo account before you trade it live.

ShareX

Related posts