hmmmmm, after thinking for a while, and keeping in mind that indicator always lags,
the easiest way to check if the current candle has closed is to use the previous candle!!
just add 1 to all the shift values, which have been conviently tagged as i
hence adding i=i+1 would do the trick!! solved by a one liner?
remember to add "i = i - 1" when exiting the "if statement" as variable "i" might be used by other statements.