EmulatedPortfolio

StockSharp.MatchingEngine

模拟投资组合的执行,跟踪职位和货币内幕。

构造函数

EmulatedPortfolio
public EmulatedPortfolio(string name, IMarkPrices markPrices)
emulatedPortfolio = EmulatedPortfolio(name, markPrices)

Initializes a new instance.

name
Portfolio name.
markPrices
Where the prices to revalue open positions come from.

属性

AvailableMoney
public decimal AvailableMoney { get; }
value = emulatedPortfolio.AvailableMoney

可用资金(现款-被冻结).

BeginMoney
public decimal BeginMoney { get; }
value = emulatedPortfolio.BeginMoney

初出钱数.

BlockedMoney
public decimal BlockedMoney { get; }
value = emulatedPortfolio.BlockedMoney

封存了待决命令的钱

Commission
public decimal Commission { get; }
value = emulatedPortfolio.Commission

佣金总额

CurrentMoney
public decimal CurrentMoney { get; }
value = emulatedPortfolio.CurrentMoney

现用货币(开始+PnL).

EnableStopOut
public bool EnableStopOut { get; set; }
value = emulatedPortfolio.EnableStopOut
emulatedPortfolio.EnableStopOut = value

停止时启用自动位置清算 。

MarginCallLevel
public decimal MarginCallLevel { get; set; }
value = emulatedPortfolio.MarginCallLevel
emulatedPortfolio.MarginCallLevel = value

边际呼叫级别阈值。 当边际级别降入此值时, 将触发警告 。

Name
public string Name { get; }
value = emulatedPortfolio.Name

名曰为相.

RealizedPnL
public decimal RealizedPnL { get; }
value = emulatedPortfolio.RealizedPnL

已实现的利润-损失的价值。

StopOutLevel
public decimal StopOutLevel { get; set; }
value = emulatedPortfolio.StopOutLevel
emulatedPortfolio.StopOutLevel = value

停止关闭的临界值。当差值降至这一值时,将清理职位。

TotalPnL
public decimal TotalPnL { get; }
value = emulatedPortfolio.TotalPnL

PnL共计(已实现 -- -- 佣金)。

UnrealizedPnL
public decimal UnrealizedPnL { get; }
value = emulatedPortfolio.UnrealizedPnL

What the open positions have gained or lost since they were taken, at the prices they could be closed at now. A position the market has not priced counts for nothing.

Version
public long Version { get; private set; }
value = emulatedPortfolio.Version
emulatedPortfolio.Version = value

Changes whenever an order, a fill or the opening state changes the account, so a report on it can be told from a newer one.

方法

CalculateUnrealizedPnL
public decimal CalculateUnrealizedPnL(Func<SecurityId, decimal?> getCurrentPrice)
result = emulatedPortfolio.CalculateUnrealizedPnL(getCurrentPrice)

计算所有职位未实现的PnL。

getCurrentPrice
获取金融工具当前市场价格的功能。 如果价格无法使用, 则返回无效 。

返回值: Total unrealized PnL.

Clear
internal void Clear()
emulatedPortfolio.Clear()

清除所有状态( 被重置 ) 。

GetAllPositions
public IEnumerable<PositionInfo> GetAllPositions()
result = emulatedPortfolio.GetAllPositions()

获取所有位置信息对象 。

GetPosition
public PositionInfo GetPosition(SecurityId securityId)
result = emulatedPortfolio.GetPosition(securityId)

获得金融工具的地位。

securityId
金融工具标识。

返回值: 位置信息或无效 。

GetPositions
public IEnumerable<ValueTuple<SecurityId, decimal, decimal>> GetPositions()
result = emulatedPortfolio.GetPositions()

都给我准备好

返回值: 数取所位.

GetUnrealizedPnL
public decimal? GetUnrealizedPnL(PositionInfo position)
result = emulatedPortfolio.GetUnrealizedPnL(position)

What one position has gained or lost since it was taken, at the price it could be closed at now.

position
A position of this portfolio.

返回值: The floating profit, zero for a flat position, or when the market has not priced an open one.

GetUnrealizedPnL
public decimal? GetUnrealizedPnL(SecurityId securityId)
result = emulatedPortfolio.GetUnrealizedPnL(securityId)

What one position has gained or lost since it was taken, at the price it could be closed at now.

securityId
Security ID.

返回值: The floating profit, zero for a flat position, or when the market has not priced an open one.

ProcessOrderCancellation
public void ProcessOrderCancellation(SecurityId securityId, Sides side, decimal volume, decimal price)
emulatedPortfolio.ProcessOrderCancellation(securityId, side, volume, price)

流程订单取消(解冻资金).

securityId
金融工具标识。
side
秩序一边.
volume
已取消的音量 。
price
用于比值计算的价格。
ProcessOrderRegistration
public void ProcessOrderRegistration(SecurityId securityId, Sides side, decimal volume, decimal price)
emulatedPortfolio.ProcessOrderRegistration(securityId, side, volume, price)

流程订单登记(区块基金)。

securityId
金融工具标识。
side
秩序一边.
volume
序卷出. 师曰.
price
差值计算定出价.
ProcessTrade
public TradeProcessingResult ProcessTrade(SecurityId securityId, Sides side, decimal price, decimal volume, decimal? commission, decimal? marginPrice)
result = emulatedPortfolio.ProcessTrade(securityId, side, price, volume, commission, marginPrice)

Process a trade execution.

securityId
Security ID.
side
Trade side.
price
Trade price.
volume
Trade volume.
commission
Commission amount.
marginPrice
Price at which the filled order reserved funds.

返回值: Trade processing result.

SetMoney
public void SetMoney(decimal money)
emulatedPortfolio.SetMoney(money)

设起先出钱.

money
钱数.
SetPosition
public void SetPosition(SecurityId securityId, decimal volume, decimal avgPrice)
emulatedPortfolio.SetPosition(securityId, volume, avgPrice)

设起起起入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入入..

securityId
金融工具标识。
volume
位置音量.
avgPrice
入场价格平均.