Indicator shows wrong results while mt4 connected to the internet

 

I have a table indicator that shows whether there is a buy or a sell signal on the last bar based on a criteria that I coded, For some reason that I don't know the indicator shows correct signals when the market is closed or the pc isn't connected to the internet and when connected the indicator shows wrong signals

any idea what might cause this or how to fix it, help is highly appreciated

Thanks in advance

Reason: