Please refer to the EA log printed below. I found "136" means "Off Quotes". Does it mean that my requesting price was re-quoted? Or is it just a slippage?
Moreover, how to know if my EA is experiencing re-quote or slippage? How to know if re-quotes happen to me?
2015.09.29 09:23:08: closeBuy with Slippage Target 85 -error: 136
136 ERR_OFF_QUOTES Off quotes
closeBuy with Slippage Target 85 -error:
it seems to me that your OrderClose() has a limit of 85 for slippage, see https://docs.mql4.com/trading/orderclose
So, you either remove that limit, or program your EA to handle that kind of situation
May I know why you suggest me to remove the slippage limit?
Hi jjc, thanks for comment.
Ok, instead of removing it you can raise it as well. But in general I believe it could be better to try to avoid situations where big slippage happens, such as during big impact news release. In those cases, while a slippage may be in your favor*, there is a small possibility to go against you, and in that case you would most likely want to get out of market as quickly as possible; of course it is all up to your strategy and EA, I am only saying that maybe it is better to accept the big slippage that hits you the first time, because things can get even worse and the price may not return where you would like it to be - in a timely manner
* Some more remarks. I am pretty sure close orders in MetaTrader are market orders and only the presence of slippage int OrderClose() give us a chance to control the price of the order closing; for what I am not sure is if OrderClose() passes over us a positive slippage
Thanks for your advice. Did you know how to know the price my EA gets is a re-quote or slippage?
On those brokers that use slippage (most ECNs no longer do) the order will open if your open price (when sent) is within server's price (when at top of the queue) +/- slippage*point.
Otherwise you could get any of ERR_INVALID_PRICE (129) ERR_PRICE_CHANGED (135) ERR_OFF_QUOTES (136) or ERR_REQUOTE (138)
There is no requote price. On the next tick or after a successful RefreshRates(), you have the latest price (at last transmission from server.) Predefined Variables and RefreshRates Function - Variables - MQL4 Tutorial
To add comments, please log in or register