PositionManager
StockSharp.Algo.Positions
The position calculation manager.
Inherits: BaseLogReceiver
Implements: IPositionManager, IAsyncPersistable
Constructors
PositionManager
public PositionManager(bool byOrders, IPositionManagerState state)
positionManager = PositionManager(byOrders, state)
The position calculation manager.
- byOrders
- To calculate the position on realized volume for orders () or by trades ().
- state
- State storage.
Properties
ByOrders
public bool ByOrders { get; }
value = positionManager.ByOrders
To calculate the position on realized volume for orders () or by trades ().
Methods
CloneAsync
public ValueTask<IPositionManager> CloneAsync(CancellationToken cancellationToken)
result = positionManager.CloneAsync(cancellationToken)
Create a copy of the manager.
- cancellationToken
- CancellationToken
Returns: Copy.
ProcessMessage
public virtual PositionChangeMessage ProcessMessage(Message message)
result = positionManager.ProcessMessage(message)
To calculate position.
- message
- Message.
Returns: The position by order or trade.