
The method CloseOrder does not have a return value and accepts the order that needs to be withdrawn from the exchange.
public void CloseOrder(Order order)
The method can be useful, for example, when a partially opened order needs to be withdrawn.

1. We iterate through all opening orders in the position.
2. If an order has been partially executed, we enter the body of the conditional structure.
3. We withdraw the not fully opened order.
If you have any difficulties or questions, please write to the support chat. Link