My trades getting rejected again and again.

Manpreet Singh  

I am facing a problem that when condition on my robot meet to open a trade, trade get rejected, please suggest what is the reason and how to fix it?


Manpreet Singh  
Vladimir Karputov #:
Perhaps you have set a very small slippage.

Thanks, but i have already tried this, what could be the other reason ?

Carl Schreiber  
Manpreet Singh #:

Thanks, but i have already tried this, what could be the other reason ?

Your EA should print the server error...
Vladimir Karputov  
Manpreet Singh # :

Thanks, but i have already tried this, what could be the other reason ?

1. How exactly did you try? What exactly did you do?

2. You do not update prices before submitting a trade order.

William Roeder  
Manpreet Singh:I am facing a problem … how to fix it?

Do you really expect an answer? There are no mind readers here and our crystal balls are cracked. Always post all relevant code (using Code button) or attach the source file.
     How To Ask Questions The Smart Way. (2004)
          Be precise and informative about your problem

We can't see your broken code.

Manpreet Singh  
Vladimir Karputov #:

1. How exactly did you try? What exactly did you do?

2. You do not update prices before submitting a trade order.

I change the slippage in source code to 10, previously it was 3.

FYI, EA is running perfectly from past few weeks till today london session.

Manpreet Singh  
Carl Schreiber #:
Your EA should print the server error...

These are the errors it is showing.

Carl Schreiber  
Manpreet Singh #:

These are the errors it is showing.

So check your request: Buy, Sell, Bid, Ask, price, SL, TP, minimum distances .. and print that out.
Fernando Carreiro  
Manpreet Singh #:I change the slippage in source code to 10, previously it was 3. FYI, EA is running perfectly from past few weeks till today london session.

Please be aware that the slippage/deviation parameter is in points. So a value of 10 is 1.0 pip and a value of 3 is 0.3 pips.

Also you are not printing the exact error code returned by the trade server. You are just printing out that the OrderSend was rejected.

Print that actual return code and see WHY it was rejected. See MqlTradeResult documentation for the "retcode_external" field.


Documentation on MQL5: Constants, Enumerations and Structures / Data Structures / Trade Request Result Structure
Documentation on MQL5: Constants, Enumerations and Structures / Data Structures / Trade Request Result Structure
  • www.mql5.com
Trade Request Result Structure - Data Structures - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
vasudevaNyadav  
William Roeder #:

Do you really expect an answer? There are no mind readers here and our crystal balls are cracked. Always post all relevant code (using Code button) or attach the source file.
     How To Ask Questions The Smart Way. (2004)
          Be precise and informative about your problem

We can't see your broken code.

trading some problem  buy or sell order is rejected
Reason: