Suppose I place an order for 200 units and different trades are executed to cover 175 units, not 200. If I use a script to exit all 200 units at a certain price, what will happen? Will new trades be opened for the remaining 25 units that were not covered? I would appreciate your advice on the recommended approach for this situation. Should I check the allocated units through the orderid and place an opposite side order to exit the allocated quantity if it's less than the planned quantity?
If you placed an order that is partially filled as mentioned above for 175 and you place an order with opposite transaction type for 200 quantity then you will end up with open position on the opposite side (-25 net quantity)