Flipping from Long to Short

New here and playing around with paper trading. I want to flip a short position to long (or vice versa) in one trade. I know I could stagger 2 trades to close out and then establish a new position. But I would like to do this at the Market Close (MOC). How can I do this? And if not, why not? Thanks!