InMemoryPositionStorage

StockSharp.Algo.Storages

In memory implementation of IPositionStorage.

Implements: IPositionStorage, IPositionProvider, IPortfolioProvider

Constructors

InMemoryPositionStorage()

Initializes a new instance of the InMemoryPositionStorage.

InMemoryPositionStorage(IPortfolioProvider)

Initializes a new instance of the InMemoryPositionStorage.

underlying
Underlying provider.

Properties

Portfolios : IEnumerable<Portfolio>

The list of portfolios.

Positions : IEnumerable<Position>

The list of positions.

Methods

Delete(Portfolio)

Delete portfolio.

portfolio
Portfolio.
Delete(Position)

Delete position.

position
Position.
EnterScope() : Scope

Enter sync scope.

Returns: Sync scope.

GetPosition(Portfolio, Security, string, Sides?, string, string, TPlusLimits?) : Position

To get the position by portfolio and instrument.

portfolio
The portfolio on which the position should be found.
security
The instrument on which the position should be found.
strategyId
Strategy ID.
side
Side.
clientCode
The client code.
depoName
The depository name where the stock is located physically. By default, an empty string is passed, which means the total position by all depositories.
limit
Limit type for Т+ market.

Returns: Position.

LookupByPortfolioName(string) : Portfolio

To get the portfolio by the code name.

name
Portfolio code name.

Returns: The got portfolio. If there is no portfolio by given criteria, is returned.

Save(Portfolio)

Save portfolio.

portfolio
Portfolio.
Save(Position)

Save position.

position
Position.

Events

NewPortfolio : Action<Portfolio>

New portfolio received.

NewPosition : Action<Position>

New position received.

PortfolioChanged : Action<Portfolio>

Portfolio changed.

PositionChanged : Action<Position>

Position changed.