Why don't you sell orders in steps, closing the part that is in profit by partially closing the order?