Thank you so much, sorted.Your OnCalculate uses capitalized "Time" for a time timeseries, so your alert checks should also use "Time" instead of "time".
Please can you help..... after some time the indicator lines are distorted or upon initializing MT5, I have to switch between timeframes to get it back to normal.