EmulatedPortfolioManager

StockSharp.MatchingEngine

组合管理器, 创建模拟组合的模拟内置。

实现: IMarkPrices

属性

InitialMoney
public Func<string, decimal?> InitialMoney { get; set; }
value = emulatedPortfolioManager.InitialMoney
emulatedPortfolioManager.InitialMoney = value

The money an account holds when it is opened, by the account's name, or for an account that opens empty.

MarginController
public IMarginController MarginController { get; set; }
value = emulatedPortfolioManager.MarginController
emulatedPortfolioManager.MarginController = value

命令验证的边距控制器 。

MarkPrices
public IMarkPrices MarkPrices { get; set; }
value = emulatedPortfolioManager.MarkPrices
emulatedPortfolioManager.MarkPrices = value

Where the prices to revalue open positions come from. Until the engine supplies them every position is worth what it cost.

方法

Clear
public void Clear()
emulatedPortfolioManager.Clear()

清除所有适配状态, 并重置当前状态以断开连接 。

GetAllPortfolios
public IEnumerable<EmulatedPortfolio> GetAllPortfolios()
result = emulatedPortfolioManager.GetAllPortfolios()

拿到所有的项目

GetPortfolio
public EmulatedPortfolio GetPortfolio(string name)
result = emulatedPortfolioManager.GetPortfolio(name)

获取或创建一个名称的组合 。

name
组合名.

返回值: 组合实例。

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

检查组合是否存在 。

name
组合名.

返回值: 真实的,如果存在。

TryGetPortfolio
public virtual bool TryGetPortfolio(string name, EmulatedPortfolio portfolio)
result = emulatedPortfolioManager.TryGetPortfolio(name, portfolio)

Look an account up without opening one, unlike String), which creates the account when the name is unknown.

name
Portfolio name.
portfolio
The account, or when no account carries that name.

返回值: when the account exists.

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

核实该组合有足够的资金进行订单登记。

portfolioName
组合名.
securityId
金融工具标识(用于每个位置的杠杆).
price
订价.
volume
序卷出. 师曰.

返回值: 如果资金不足,则错误无效。