But keep in mind, this condition will only enter or exit upon closure of the candle, so it will not enter/exit on the same price as the moving average. Price can cross and close above/below the moving average as well, and it will still count.
For example, if you wanted to code a strategy where one of the entry conditions was:
Price tests the 21 EMA at some point within the candle.
You would input it like this: