Need help trying to set up an intraday scan where the candlestick crosses above the 200EMA

This is how I currently have it setup, but it's far from perfect:

input slowLength = 200;

input averageType = AverageType.EXPONENTIAL;

def SlowMA = MovingAverage(averageType, close, slowLength);

def condition = (open < SlowMA) and (close > SlowMA);

plot scan = condition;

It always seems to be finicky when I do intraday aggregration periods without extended hours. I want it to only alert me when the candlestick actually closes above the 200EMA. For example, I could be alerted at the time it appears in the picture shown, but that same candle could still expire below the 200EMA if that makes sense.

/r/thinkorswim Thread Link - i.redd.it