https://docs.mql4.com/check/isconnected

This seems to the flag for MT4.

LastError() code can also be used - to signal a relevant error.

Both MultiCharts and SierraChart use IB API error codes to determine the status of connection. SC then exposes this further to a user via a variable at run-time.