Class InMemoryPositionStorage
- Namespace
- StockSharp.Algo.Storages
- Assembly
- StockSharp.Algo.dll
In memory implementation of IPositionStorage.
public class InMemoryPositionStorage : IPositionStorage, IPositionProvider, IPortfolioProvider
- Inheritance
-
InMemoryPositionStorage
- Implements
- Inherited Members
- Extension Methods
Constructors
InMemoryPositionStorage()
Initializes a new instance of the InMemoryPositionStorage.
public InMemoryPositionStorage()
InMemoryPositionStorage(IPortfolioProvider)
Initializes a new instance of the InMemoryPositionStorage.
public InMemoryPositionStorage(IPortfolioProvider underlying)
Parameters
underlyingIPortfolioProviderUnderlying provider.
Properties
Portfolios
Get all portfolios.
public IEnumerable<Portfolio> Portfolios { get; }
Property Value
Positions
Get all positions.
public IEnumerable<Position> Positions { get; }
Property Value
SyncRoot
Sync object.
public SyncObject SyncRoot { get; }
Property Value
Methods
Delete(Portfolio)
Delete portfolio.
public void Delete(Portfolio portfolio)
Parameters
portfolioPortfolioPortfolio.
Delete(Position)
Delete position.
public void Delete(Position position)
Parameters
positionPositionPosition.
GetPosition(Portfolio, Security, string, Sides?, string, string, TPlusLimits?)
To get the position by portfolio and instrument.
public Position GetPosition(Portfolio portfolio, Security security, string strategyId, Sides? side, string clientCode = "", string depoName = "", TPlusLimits? limitType = null)
Parameters
portfolioPortfolioThe portfolio on which the position should be found.
securitySecurityThe instrument on which the position should be found.
strategyIdstringStrategy ID.
sideSides?Side.
clientCodestringThe client code.
depoNamestringThe depository name where the stock is located physically. By default, an empty string is passed, which means the total position by all depositories.
limitTypeTPlusLimits?Limit type for Т+ market.
Returns
- Position
Position.
LookupByPortfolioName(string)
To get the portfolio by the code name.
public Portfolio LookupByPortfolioName(string name)
Parameters
namestringPortfolio code name.
Returns
Save(Portfolio)
Save portfolio.
public void Save(Portfolio portfolio)
Parameters
portfolioPortfolioPortfolio.
Save(Position)
Save position.
public void Save(Position position)
Parameters
positionPositionPosition.
Events
NewPortfolio
New portfolio received.
public event Action<Portfolio> NewPortfolio
Event Type
NewPosition
New position received.
public event Action<Position> NewPosition
Event Type
PortfolioChanged
Portfolio changed.
public event Action<Portfolio> PortfolioChanged
Event Type
PositionChanged
Position changed.
public event Action<Position> PositionChanged