Buy EMA exit based on 30 EMA

Need Exit trades blocks.
Set 1 If Prev candle close below 30EMA exit from long if long trade running.
Set 2 If prev candle close above 30EMA exit from short if short trade running.

Below example if for long exit when previous 5 min candle of Nifty futures closes below 30 EMA. Use this in exit condition

image