If you place an order during market hours, your order may be filled instantly. So you may not have the ability to cancel. So you'll need to sell out of the holdings.
However, if you place an order outside of market hours you'll be able to cancel at anytime prior to market open.