MQL5 : Events triggered when server disconnects and reconnects??

 

Hi,

What events are triggered/generated when MT5 gets disconnected from the server and then reconnects?

OnInit? OnDeinit? OnTick?

How can I get/catch the error code?

Thanks

 

Times out (30? seconds) reconnects, updates history, next tick is processed.

There is no error code because your code wasn't running.

 

There's something similar being reported lately , the trades fail with retcode 10031 , lost connection to trade server 

but they are gated with 

bool IsConnected(){
bool result=(bool)TerminalInfoInteger(TERMINAL_CONNECTED);
return(result);
}

alongside spread ,margin, trading allowance, symbol session, checks .