...signals are shifted one candle to the left - Right. And so is the alert.
Looking at it differently, notice the offset=-1 parameter in the plot function in the original and this version. I left it unchanged, but my current version allows to omit this parameter and still have the outcome as in the original with the difference that the signal becomes more precise, by 1 candle. Did I answer your question?
Any help would be appreciated and thank you again.