The error code 4756 means "Trade request sending failed".
Is any messages in client terminal log?
Please write to servicedesk. Do not forget to specify build number, server you are connecting to and attach logs of expert and client terminal.
- www.mql5.com
Do you use the same method to calculate SL and TP for both operations - Buy and Sell?
request.sl =NormalizeDouble(dPrice-iSign*StopLoss*MyPoint,_Digits); request.tp =NormalizeDouble(dPrice+iSign*TakeProfit*MyPoint,_Digits);If your answer is Yes it is not surprise.
Do you use the same method to calculate SL and TP for both operations - Buy and Sell?
If your answer is Yes it is not surprise.One way or another is started to work - but I had connections problems - the same code no changes and now it works
Rosh - about you question
It is not the same method for SL and TP - if you will be more attentive you will see that there is no error in Stop Loss and Take Profit calculations - they all are calculated in the right way
beside this if I had any problems in SL or TP the error message would be [Invalid Stops]
anyway - if you will take a closer look in the code you will see that this is not the case
I was thinking maybe I have some errors in writing the "request" parameters - but they all look ok - so I am more of confidence that this seems to be connectivity issues or a bug
By the way - another question for you guys - in order to close a sell order we need to open a buy one?
It looks I did not found a corresponding of OrderClose function of mql4 for mql5
thx for your time and consideration
- www.mql5.com
Rosh - about you question
It is not the same method for SL and TP - if you will be more attentive you will see that there is no error in Stop Loss and Take Profit calculations - they all are calculated in the right way
anyway - if you will take a closer look in the code you will see that this is not the case
I was thinking maybe I have some errors in writing the "request" parameters - but they all look ok - so I am more of confidence that this seems to be connectivity issues or a bug
By the way - another question for you guys - in order to close a sell order we need to open a buy one?
It looks I did not found a corresponding of OrderClose function of mql4 for mql5
Yes, you have to do opposite operation to close open position.
Thank you Rosh for your replies
I found a solution before but forgot to post in here
I think it is also somewhere here in forum
all you need to do is this:
before changing any of the request parameter add this line of code : ZeroMemory(request);
MqlTradeRequest request; MqlTradeResult result; MqlTradeCheckResult checkresult; ZeroMemory(request); request.action = TRADE_ACTION_DEAL; request.magic = MagicNumber;
at least this worked for me
I found a solution before but forgot to post in here
I think it is also somewhere here in forum
all you need to do is this:
before changing any of the request parameter add this line of code : ZeroMemory(request);
at least this worked for me
Thanks eronyx,
Appreciate you sharing, this magically worked for me!

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi guys
I'm moving from mql4 to mql5
so far so good
I've read few tutorials on how properly to make an EA and check for errors but I'm still struggling to make this one working
I tried debugging it and got all the necessary error codes but they don;t help at all
please help me - this thing kills me already for few days - sometimes it works and opens orders sometimes it doesn;t
here are the errors:
Error opening Order 4756
failed instant sell 0.30 EURUSD at 1.42185 sl: 1.43185 tp: 1.41685 (deviation: 30) [Invalid request]
the return code from return.retcode = 10013 which is the same as Invalid Request
10013
TRADE_RETCODE_INVALID
Invalid request
from my side it looks to be a bug - because sometimes it opens the trades very nice - sometimes it does not open and only provides this errors like a lot of them which really pisses me off
does anyone of you have any experience with this?
thank you in advance guys