Simple EMA break and retest

 
Hello all, I’m trying to write an ea where when price breaks an EMA, and comes back to touch it again, I’m placing an order to anticipate a bounce.

I’ve tried this but lots of trades are missed:

Buy if previous candle low > previous EMA and current close <= current EMA

The first part simulates a break and the second part simulates touching the ema again

If you have any suggestions that would be greatly appreciated!
Reason: