IPortfolioManager

StockSharp.MatchingEngine

Interface for managing multiple portfolios. Abstracts portfolio state management to support both emulated and real portfolios.

Methods

Clear
public void Clear()
iPortfolioManager.Clear()

Clear all portfolio state.

GetAllPortfolios
public IEnumerable<IPortfolio> GetAllPortfolios()
result = iPortfolioManager.GetAllPortfolios()

Get all portfolios.

GetPortfolio
public IPortfolio GetPortfolio(string name)
result = iPortfolioManager.GetPortfolio(name)

Get or create a portfolio by name.

name
Portfolio name.

Returns: Portfolio instance.

HasPortfolio
public bool HasPortfolio(string name)
result = iPortfolioManager.HasPortfolio(name)

Check if portfolio exists.

name
Portfolio name.

Returns: True if exists.

ValidateFunds
public InvalidOperationException ValidateFunds(string portfolioName, SecurityId securityId, decimal price, decimal volume)
result = iPortfolioManager.ValidateFunds(portfolioName, securityId, price, volume)

Validate that portfolio has sufficient funds for order registration.

portfolioName
Portfolio name.
securityId
Security ID (for per-position leverage).
price
Order price.
volume
Order volume.

Returns: Error if insufficient funds, null otherwise.