IsTradeContextBusy() MQL4 function alternative in MQL5 ?

To add comments, please log in or register
Laurent Soudron
931
Laurent Soudron  

Hello,

How to obtain in MQL5 the equivalent of the IsTradeContextBusy() function that there was in MQL4?

This is to avoid 4756 (Trade request sending failed) errors that happen from time to time with trade.PositionClose(position_ticket, slippage)

Thanks

William Roeder
20756
William Roeder  
  1. Context busy hasn't been necessary since MT4 went from one to 8 contexts. (MT5 already had 8.)
  2. Sending failed sounds like a network problem. Log it, return, wait for the next tick, retry.
Laurent Soudron
931
Laurent Soudron  
Thank you for your quick reply. I get this error in backtest sometimes, but I have not yet had it during my tests with a demo account.
To add comments, please log in or register