
The main purpose of the journal is to store and process all positions belonging to one tab. The journal contains a general list for all the positions it stores, as well as subdivisions into several lists based on the state or type of position.
public Position PositionsLast
Returns a reference to the last position in the list of all positions or null if the list of positions is empty.

public List<Position> PositionsAll
This property returns the list of all positions belonging to the tab, regardless of their state.

public List<Position> PositionsOpenAll
Returns the list of all open positions. A position is considered open if at least one trade has occurred for the opening order. For example, when opening a position, an order is placed to buy 100 lots. If a trade of 1 lot takes place, the order will be in the Partial state, but the position will already be considered open and have an Open state. This fact should be taken into account when writing trading logic.

public List<Position> PositionsCloseAll
Returns the list of all closed positions as well as positions that have not opened. This includes all positions with the state Done and OpeningFall. A position gets the Done status when the cumulative executed volume of closing orders becomes equal to the similar value of opening orders. The position transitions to OpeningFall state upon cancellation of the opening order in case there were no trades on it.

public List<Position> PositionOpenLong
This property returns the list of open long positions. It includes positions with the following states:
1. Opening.
2. Open.
3. ClosingFall.
4. ClosingSurplus.

public List<Position> PositionOpenShort
This property returns the list of open short positions. It includes positions with the following states:
1. Opening.
2. Open.
3. ClosingFall.
4. ClosingSurplus.

If a position had a closing order that was retracted or not accepted by the trading system, its state transitions to ClosingFall. Such a position needs to be closed again using one of the closing methods.
The state of ClosingSurplus appears in a position when the volume of closing orders exceeds the opened volume. For example, if 100 lots were bought and the cumulative executed volume of closing orders equals 110 lots, then the position will display a negative current volume of -10. This can happen for a variety of reasons, but in any case, measures must be taken to rectify the situation.
public List<PositionOpenerToStopLimit> PositionOpenerToStopsAll
This property returns the list of all pending positions. As a reminder, the PositionOpenerToStopLimit class describes the condition when the price crosses a given value, after which a real position is created.

public List<PositionOnBoard> PositionsOnBoard
Although this property is not related to the journal, it is worth mentioning in the current context. When called, the property returns the list of exchange positions corresponding to the instrument of the tab.

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