EMA crossover strategy help needed

Respected members
I wish to create EMA 5 and EMA 20 crossover strategy .along with MACD
EMA crossover takes on candle position -2 , entry point(buying) in candle 0 .
How to proceed ? please help .