InMemoryPositionStorage

StockSharp.Algo.Storages

In memory implementation of IPositionStorage.

実装: IPositionStorage, IPositionProvider, IPortfolioProvider

コンストラクター

InMemoryPositionStorage()

Initializes a new instance of the InMemoryPositionStorage.

InMemoryPositionStorage(IPortfolioProvider)

Initializes a new instance of the InMemoryPositionStorage.

underlying
Underlying provider.

プロパティ

Portfolios : IEnumerable<Portfolio>

The list of portfolios.

Positions : IEnumerable<Position>

The list of positions.

メソッド

Delete(Portfolio)

Delete portfolio.

portfolio
Portfolio.
Delete(Position)

Delete position.

position
Position.
EnterScope() : Scope

Enter sync scope.

戻り値: 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.

戻り値: Position.

LookupByPortfolioName(string) : Portfolio

To get the portfolio by the code name.

name
Portfolio code name.

戻り値: 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.

イベント

NewPortfolio : Action<Portfolio>

New portfolio received.

NewPosition : Action<Position>

New position received.

PortfolioChanged : Action<Portfolio>

Portfolio changed.

PositionChanged : Action<Position>

Position changed.