Reconnect for an Expert Advisor

Dear forex traders, friends, and colleagues, greetings to you! We continue the series of lessons on MQL programming.
Today the topic is for pros, that is, for those who have already gotten into programming, because this will be top-level aerobatics.
So, enough intrigue, attention!
Surely you have encountered the fact that after failures the terminal, as they say, "hangs" and does not reconnect to the broker automatically... Well, that's enough, we are going to fix it!
The topic of this lesson will be automatic reconnection to the broker after a disconnect, no matter what type it was.
Homework

Colleagues, add three of your accounts to "Favorites" and switch between them one by one every 120 seconds. This way you will ensure your expert advisor works on all your accounts, can you do it?
Respectfully, Sergey aka xbms TradeLikeaPro.ru
Dear forex traders, friends, and colleagues, greetings! We continue the series of lessons on MQL programming.