IPortfolioManager
StockSharp.MatchingEngine
管理多个组合的接口 。 抽象组合状态管理, 支持模拟组合和真实组合 。
方法
GetAllPortfolios
public IEnumerable<IPortfolio> GetAllPortfolios()
result = iPortfolioManager.GetAllPortfolios()
拿到所有的项目
GetPortfolio
public IPortfolio GetPortfolio(string name)
result = iPortfolioManager.GetPortfolio(name)
获取或创建一个名称的组合 。
- name
- 组合名.
返回值: 组合实例。
HasPortfolio
public bool HasPortfolio(string name)
result = iPortfolioManager.HasPortfolio(name)
检查组合是否存在 。
- name
- 组合名.
返回值: 真实的,如果存在。
ValidateFunds
public InvalidOperationException ValidateFunds(string portfolioName, SecurityId securityId, decimal price, decimal volume)
result = iPortfolioManager.ValidateFunds(portfolioName, securityId, price, volume)
核实该组合有足够的资金进行订单登记。
- portfolioName
- 组合名.
- securityId
- 金融工具标识(用于每个位置的杠杆).
- price
- 订价.
- volume
- 序卷出. 师曰.
返回值: 如果资金不足,则错误无效。