OrderBook
StockSharp.MatchingEngine
订单书执行.
实现: IOrderBook
构造函数
属性
方法
AddQuote
public void AddQuote(EmulatorOrder order)
orderBook.AddQuote(order)
入于令书中出一出引相.
- order
- 顺序或市场引号需要添加. 如果 TransactionId 是默认的,则作为市场引号处理.
ConsumeVolume
public IEnumerable<ValueTuple<decimal, decimal, IReadOnlyList<EmulatorOrder>>> ConsumeVolume(Sides side, decimal? maxPrice, decimal volume)
result = orderBook.ConsumeVolume(side, maxPrice, volume)
从最佳水平( 用于匹配) 控制音量 。
- side
- 边要从( 对面要命令) 消耗 。
- maxPrice
- 最高购入价格/最低售出价格.
- volume
- 量取所取所取.
返回值: 执行(价格、数量、所涉订单)。
GetLevels
public IEnumerable<OrderBookLevel> GetLevels(Sides side)
result = orderBook.GetLevels(side)
获得报价为一面,按价格订购(最好先).
- side
- 侧取电平
GetOrdersAtPrice
public IEnumerable<EmulatorOrder> GetOrdersAtPrice(Sides side, decimal price)
result = orderBook.GetOrdersAtPrice(side, price)
以特定价格水平获得所有用户订单.
- side
- 侧取来问.
- price
- 价格水平可查询.
GetTotalVolume
public decimal GetTotalVolume(Sides side)
result = orderBook.GetTotalVolume(side)
得到总的量为一面。
- side
- 边取总量为取.
GetVolumeAtPrice
public decimal GetVolumeAtPrice(Sides side, decimal price)
result = orderBook.GetVolumeAtPrice(side, price)
以特定价格水平获得体积.
- side
- 侧取来问.
- price
- 价格水平可查询.
GetWorstAsk
public ValueTuple<decimal, decimal>? GetWorstAsk()
result = orderBook.GetWorstAsk()
获取最差( 最高) 问关 。
GetWorstBid
public ValueTuple<decimal, decimal>? GetWorstBid()
result = orderBook.GetWorstBid()
获得最差(最低)的出价水平.
HasLevel
public bool HasLevel(Sides side, decimal price)
result = orderBook.HasLevel(side, price)
检查是否有指定价格的引文.
- side
- 侧取去检查。
- price
- 价位可查.
RemoveLevel
public IEnumerable<EmulatorOrder> RemoveLevel(Sides side, decimal price)
result = orderBook.RemoveLevel(side, price)
以价格删除整个关卡 。
- side
- 侧取去关卡 。
- price
- 价格水平要取消。
返回值: 取消了当时该级别上的命令。
RemoveQuote
public bool RemoveQuote(long transactionId, Sides side, decimal price)
result = orderBook.RemoveQuote(transactionId, side, price)
从命令书中删除引文 。
- transactionId
- 交易编号的订单删除 。
- side
- 边(买/卖)放入令所.
- price
- 价等分出令等.
返回值: 真实的,如果删除, 假的,如果找不到。
SetSnapshot
public void SetSnapshot(IEnumerable<QuoteChange> bids, IEnumerable<QuoteChange> asks)
orderBook.SetSnapshot(bids, asks)
从快照中设置命令书( 替换所有非用户引用) 。
- bids
- 报价的顺序 引用更改设置 。
- asks
- 问出引号更改的顺序
ToMessage
public QuoteChangeMessage ToMessage(DateTime localTime, DateTime serverTime)
result = orderBook.ToMessage(localTime, serverTime)
从当前状态创建 QuoteChangeMessage 。
- localTime
- 本地时间设定生成的消息 。
- serverTime
- 服务器设置生成信件的时间 。
TrimToDepth
public IEnumerable<EmulatorOrder> TrimToDepth(Sides side, int maxDepth)
result = orderBook.TrimToDepth(side, maxDepth)
删除最差的超出最大深度的级别 。
- side
- 侧取去修剪.
- maxDepth
- 最大允许的深度 。
返回值: 取消了从修剪级别发出的命令。
TryRemoveOrder
public bool TryRemoveOrder(long transactionId, Sides side, EmulatorOrder order)
result = orderBook.TryRemoveOrder(transactionId, side, order)
查找并删除任何关卡的交易编号顺序 。
UpdateLevel
public void UpdateLevel(Sides side, decimal price, decimal volume)
orderBook.UpdateLevel(side, price, volume)
更新量为价格水平(用于市场报价).
- side
- 侧向更新。
- price
- 价格水平要更新。
- volume
- 一级新市场量.