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.