is there a way to get a notification via email or push to mobile devices if the MetaTrader client running on a server goes offline (no connection bottom right corner)?
This would avoid offline times and missing action form the trading signal.
It will not work that easily, because if it is disconnected there will not be any incoming ticks. Your code will have to be placed in the OnTimer() event handler for it to function usefully. Also, it takes a while for the terminal to recognise that it is disconnected so it will have a long delay before IsConnected() actually returns a false value.
This is a conundrum...
There will be a high chance that when MT is disconnected from the Broker server would be because of the connection of machine running the MT instance... So, how can you send a message to the outside world if you have NO connection at all?
Maybe you can do the opposite, monitoring your server (assuming, i.e. A VPS server) from the outside. If it does not respond, you send an Alert message... There are several free/paid services like this out there...
You can place limit orders so far off market and at volumes that wouldn't fill anyway -- and use the comment field as a tiny messaging service. A monitor EA on a separate machine then monitors the orders (with specific Magic) and deletes them after collecting the message... If the trading bot fails to check-in then have the monitor alert you...