Is it possible to code a strategy to exit open position intraday?

I want to backtest a code for intraday only.

As per the above condition is not possible to code with tradescript