Check the current time in your TMF and wait with the exit until the time is inside market hours.