OrderSend Error 138 (Requote)

OrderSend Error 138 (or ERR_REQUOTE) may appear during the execution (but not backtesting) of the MetaTrader expert advisors (only in MT4, as the MetaTrader 5 platform uses a different system of OrderSend error codes). Error 138 means that the broker replied with a “Requote” signal to your expert advisor’s OrderSend function. That means that the price used in the order is outdated compared to the current market price. There are two main reasons for this error to appear:

  • The order price is completely outdated and isn’t present in the recent quotes. The order won’t be executed (and the error 138 will be generated) even if the current market price is within the given Slippage from the order price.
  • The order price is present in the recent quotes but differs from the current market price by more than the given Slippage.
  • To avoid getting OrderSend Error 138 from your expert advisors, you have to use RefreshRates() function call immediately before OrderSend() function and before you use the Ask/Bid to calculate parameters of OrderSend() function. This will save you from the first of the cases listed above, but only if your broker isn’t experiencing any technical problems, if it does, there’s little you can do with that.
    Additionally you should specify a rather high slippage in the parameters of the OrderSend() function to prevent error 138 from appearing during very volatile conditions. Even if you use the RefreshRates() function, there’s a possibility that prices will change between it and the call of OrderSend(). A slippage of 5–10 pips (normal, not fractional) will allow your expert advisors to execute orders without requote errors. Of course, if you are scalping or otherwise aiming for small profit targets, you should set a much lower slippage and bear with the error 138 and failed orders. As an option, you can always switch your Forex broker to one with less slippage and requotes.

    If you have any thoughts, comments or questions regarding MT4 OrderSend Error 138 and the ways to treat it, feel free to reply to this post using the form below.

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    + 42 = forty six