IPortfolioManager

StockSharp.MatchingEngine

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

Methods

Clear()

Clear all portfolio state.

GetAllPortfolios() : IEnumerable<IPortfolio>

Get all portfolios.

GetPortfolio(string) : IPortfolio

Get or create a portfolio by name.

name
Portfolio name.

Returns: Portfolio instance.

HasPortfolio(string) : bool

Check if portfolio exists.

name
Portfolio name.

Returns: True if exists.

ValidateFunds(string, SecurityId, decimal, decimal) : InvalidOperationException

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.