MT5 error 4756: Trade request sending failed (ERR_TRADE_SEND_FAILED)
OrderSend returned false. The real reason is in the result's retcode, which also tells you whether the order may have executed.
What it means
You see this code in GetLastError() in MQL5, after a function fails.
4756 is the general error MQL5 sets when OrderSend() or OrderSendAsync() fails. On its own it says little.
The detail is in MqlTradeResult.retcode. That code, such as 10016 or 10031, is what you should act on.
Common causes
- Any trade server refusal, such as invalid stops, no money or market closed.
- A lost connection while sending.
- A request that failed the terminal's own checks.
How to fix it
- Always read
result.retcodeandresult.commentwhenOrderSend()returns false. - Handle the retcode, not 4756.
- Use
OrderCheck()before sending to catch request problems early.
Example in MQL5:
MqlTradeResult res = {};
ResetLastError();
if(!OrderSend(req, res))
{
PrintFormat("OrderSend failed: error %d, retcode %u (%s)",
GetLastError(), res.retcode, res.comment);
if(res.retcode == TRADE_RETCODE_CONNECTION || res.retcode == TRADE_RETCODE_TIMEOUT)
Print("Outcome unclear: check positions and deals before retrying");
} Is it safe to retry?
Check first. It depends on the retcode. Some are safe to retry, some mean the order may already exist.
Could the order have executed?
Maybe. It depends on the retcode. A refusal means no; 10031, 10011 or 10012 mean maybe.
How Tickwire handles it
Tickwire always returns the broker's own code in numericCode and stringCode, plus an outcome, so you act on the real reason. See trade results.
Related codes
One API for MT4 and MT5
Clear trade outcomes, idempotent orders and an audit log. Read the error reference or the quickstart.