Requote issue

 

Hi all,

Sometimes when we want to close an order  an error message from the broker says that the price is invalid and  we have to confirm to close the order.

In that case how is possible to confirm this with code ?

What I mean is if we can retry the OrdeSsend until ticket is different from zero how can we do the same in case of close ?

Thank you in advance for any help provided.

Luis 

 
OrderClose() returns a bool.  So, simply test to determine whether OrderClose() returns true...if it returns false, determine why it failed (for example, ERR_REQUOTE) and then retry the OrderClose().
 
luisneves:

Hi all,

Sometimes when we want to close an order  an error message from the broker says that the price is invalid and  we have to confirm to close the order.

In that case how is possible to confirm this with code ?

What I mean is if we can retry the OrdeSsend until ticket is different from zero how can we do the same in case of close ?

If you look at the error message in the documentation a recommendation is give for the action that your code should take,  so for a requote error, error 138 ERR_REQUOTE  you should follow this . . .

"The requested price has become out of date or bid and ask prices have been mixed up. The data can be refreshed without any delay using the RefreshRates function and make a retry. If the error does not disappear, all attempts to trade must be stopped, the program logic must be changed."

 
luisneves:
Sometimes when we want to close an order an error message from the broker says that the price is invalid and we have to confirm to close the order.
In that case how is possible to confirm this with code ?
  1. If you pass a valid price [OrderClosePrice()] and a reasonable slippage (adjusted for 4/5 digit brokers) you shouldn't get requote (except perhaps during news). Find out why.
  2. OrderClose returns a bool. What are Function return values ? How do I use them ? - MQL4 forum



Reason: