How do I code to EXIT at the and of the day for all my intraday trading based on 5 Minute candle?

How do I code to EXIT at the and of the day for all my intraday trading based on 5 Minute candle?

Regards,

Naveen

Your question is not clear please specify the condition in brief, if you are looking for a close on intraday you can select MIS

I have created a script to back test my strategy for Nifty Futures.
Buy:
RSI (CLOSE, 9) > 30 AND
RSI (REF (CLOSE,1), 9) < 30 AND
SOPD (9, 3, 9, SIMPLE) < 25
I would like to exit at the end of day. I do not want to keep it for next day.