Stop working for offline internet connection

Hi guys,

Hope you all are doing great,

I want to know whether there is a way to stop a custom indicator from working when the internet connection is offline or not ?

thanking in advance;

Parham 

It will stop working when there is no internet connection.
deysmacro:
It will stop working when there is no internet connection.

I've written a custom indicator that draw line by changing inputs and even when the internet connection is disconnected it continue its working and does not stop.

Never try

IsConnected() 

?

It seems to solve my problem!

thank you so much