
The CloseAtAceberg methods close a position using an iceberg order. Let me remind you that all iceberg orders in the program are emulated as follows: the volume is divided into a number of limit orders determined by the parameter orderCount. These orders are sent to the exchange sequentially, as they get filled.
public void CloseAtAceberg(Position position, decimal priceLimit, decimal volume, int orderCount, string signalType)
1. position – the position that needs to be closed;
2. priceLimit – the price for the iceberg order;
3. volume – the volume for the iceberg order;
4. orderCount – the number of orders to which the volume will be distributed;
5. signalType – the signal for closure;

1. The logic for opening positions.
2. Clear the iceberg orders that have not been executed at all or have been partially executed.
3. Determine the number of orders already filled that participated in closing the position.
4. Calculate the value for the orderCount parameter.
5. Send the command to close the position using an iceberg order.
6. Close everything at the market if the specified time has expired.
public void CloseAtAceberg(Position position, decimal priceLimit, decimal volume, int orderCount)
The method performs absolutely the same actions as the previous one, except for processing the signal for closure.
If you have any difficulties or questions, please write to the support chat. Link