Please correct me if wrong. I cannot see an option that will all close pending orders whilst allowing algo trading to continue if there is an open trade.
To clarify, I have a bot that allows the user to set trading hours but it is limited to one setting per day, eg Thurs 02-22. I have found a particular day that has x2 sessions within the day (02-06 and then 14-17) that are profitable, whilst, running the bot from 02-17 is not so much. The bot sets a number of pending orders and cancels them when inactive. An trade opened within the specified hours is allowed to run beyond the time setting and continues to be managed by the bot with trailing stops etc.