re quote in mt5

 
How to fix re quote problem in mt5 expert adviser 
 
fix your code
 
Manish Sathe: How to fix re quote problem in mt5 expert adviser 

First you should research what a "re-quote" is. You should learn what execution policies are and the difference between "Instant" and "Market" execution policies.

You should also learn about maximum deviation (slippage) and how to set it in your order placement. You should also decide how you should handle re-quotes according to your trading strategy.

And then finally, once you understand all that, then you can go back to your MQL code and apply that logic to it.

 

Forum on trading, automated trading systems and testing trading strategies

Avoid Slippage without Pending Orders.

Fernando Carreiro, 2021.07.26 22:56

As I have already explained, for "Market Execution" policy, the opening price is ignored and you will get whatever price is available at the time.

With "Instant Execution" policy, then the price is important and if it deviates too far away from the current price, you will get a "requote" error.

Remember that Buy orders open at the Ask price and close at the Bid price, and Sell orders open at the Bid price and close at the Ask price.

EDIT: Also read the following:

 
Fernando Carreiro #:

2022.04.22 15:54:45.436 Trades '60313535': failed instant buy 0.5 XAUUSD at 1932.233, close #174994347 sell 0.5 XAUUSD 1934.699 (deviation: 30) [No prices]

this is the error i got
 
Manish Sathe #: 2022.04.22 15:54:45.436 Trades '60313535': failed instant buy 0.5 XAUUSD at 1932.233, close #174994347 sell 0.5 XAUUSD 1934.699 (deviation: 30) [No prices]
this is the error i got

Then please take the time to read about "Instant Execution Policy"!

You have set a maximum deviation of 30 points when XAUUSD can easily have a minimum spread of 300 spread, so 30 point maximum slippage is extremely tight.

So print out both the Ask and Bid Prices with the order details, including the error code.

Also remember, that you Buy at the Ask price and you Sell at the Bid price.

Reason: