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
注文検証用のMarginコントローラー。
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.
メソッド
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
- 金融商品ID(ポジションごとのレバレッジ)
- price
- 注文価格。
- volume
- 注文数量。
戻り値: 不十分な資金がある場合、エラー、それ以外の場合は無効です。