Entry And Exit on close to close basis

Hello, Can someone please help me achieve the following-

Timeframe 1Day

{Todays close greater than 20Ema, yesterday’s close lower than yesterday’s 20Ema and Yesterday’s close greater than Yesterday’s 50ema }

I want to enter at today’s close ( after 3.25 ) and exit next day/tomorrow at 3:25.

Can Someone please help me either explain or code it.

Thank You in Advance