I'm backtesting an intraday strategy and I would like it to flatten all open positions at a specific time. I am trying to do this by running the strategy with ExitOnClose turned on, and ExitOnClose Seconds set to 6300. The trading session ends at 4:15PM CST and I would like to exit all open positions at 2:30PM CST.
When I backtest however the strategy exits all open positions at 4:15PM. It doesn't seem to matter what value I put for ExitOnClose Seconds, it always exits at 4:15PM. Why is this happening?
Is there a better way to handle a timed exit?
Comment