Detect lost connection to broker server

 

Hello, is there a way to detect lost of connection to broker server and send notification/email ?

Anyway has code to do this? or give me some hint on this code.

recnetly my broker alway has intermitten connection issue which result in EA not able to close or open position

 
Sunfire:

Hello, is there a way to detect lost of connection to broker server and send notification/email ?

Anyway has code to do this? or give me some hint on this code.

recnetly my broker alway has intermitten connection issue which result in EA not able to close or open position

Use TerminalInfoInteger(TERMINAL_CONNECTED)

Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Client Terminal Properties
Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Client Terminal Properties
  • www.mql5.com
Client Terminal Properties - Environment State - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
Reason: