BuyAtAceberg

BuyAtAceberg

The BuyAtAceberg methods are used for opening long positions in which the opening orders are placed as iceberg orders. In reality, iceberg orders are emulated by the program. The volume passed to the method is split into several orders depending on the orderCount parameter, and these orders are placed sequentially as the previous ones are filled.

public Position BuyAtAceberg(decimal volume, decimal price, int orderCount)

1. volume – the total volume for the position;

2. price – the price at which the orders will be placed;

3. orderCount – the number of orders into which the position volume will be distributed;

We want to buy 100 lots but do not want to reveal the entire volume in the order book. The program will divide the volume into 5 parts and place the first buy order with a volume of 20. After it is filled, the next one will be placed, and so on, until 100 lots are accumulated.

public Position BuyAtAceberg(decimal volume, decimal price, int orderCount, string signalType)

The method performs all the same actions as the previous one, but in addition, it takes a string as the signal name in the signalType parameter.

1. Create a string-type variable and, depending on the current market time, initialize it with the appropriate value.

2. Open a long position using an iceberg order.

3. Access the SignalTypeOpen field on the position instance to obtain its value and output an informational message in the log about which signal was involved.

As a result, we can see the names of the signals in the position tables in the program's interface.

If you have any difficulties or questions, please write to the support chat. Link