IsTradeContextBusy() MQL4 function alternative in MQL5 ?

 

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

 
  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.
 
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.
Reason: