IOrderBook
Interface for order book management.
Eigenschaften
BestAsk : ValueTuple?<decimal, decimal>
Get best ask price and volume.
BestBid : ValueTuple?<decimal, decimal>
Get best bid price and volume.
SecurityId : SecurityId
Security ID.
TotalAskVolume : decimal
Total volume of all asks.
TotalBidVolume : decimal
Total volume of all bids.
Methoden
AddQuote(EmulatorOrder)
Add a quote to the order book.
- order
- Order or market quote to add. If TransactionId is default, it is treated as a market quote.
Clear()
Clear all quotes.
GetLevels(Sides) : IEnumerable<OrderBookLevel>
Get quotes for a side, ordered by price (best first).
- side
- Side to retrieve levels for.
GetOrdersAtPrice(Sides, decimal) : IEnumerable<EmulatorOrder>
Get all user orders at a specific price level.
- side
- Side to query.
- price
- Price level to query.
GetVolumeAtPrice(Sides, decimal) : decimal
Get volume at a specific price level.
- side
- Side to query.
- price
- Price level to query.
HasLevel(Sides, decimal) : bool
Check if there's a quote at the specified price.
- side
- Side to check.
- price
- Price level to check.
RemoveLevel(Sides, decimal) : IEnumerable<EmulatorOrder>
Remove entire level at price.
- side
- Side to remove level from.
- price
- Price level to remove.
Rückgabe: Removed orders that were present at that level.
RemoveQuote(long, Sides, decimal) : bool
Remove a quote from the order book.
- transactionId
- Transaction id of the order to remove.
- side
- Side (buy/sell) where the order is placed.
- price
- Price level of the order.
Rückgabe: True if removed, false if not found.
SetSnapshot(IEnumerable<QuoteChange>, IEnumerable<QuoteChange>)
Set the order book from a snapshot (replaces all non-user quotes).
- bids
- Sequence of bid quote changes to set.
- asks
- Sequence of ask quote changes to set.
ToMessage(DateTime, DateTime) : QuoteChangeMessage
Create a QuoteChangeMessage from current state.
- localTime
- Local time to set on the generated message.
- serverTime
- Server time to set on the generated message.
TrimToDepth(Sides, int) : IEnumerable<EmulatorOrder>
Remove worst levels that exceed max depth.
- side
- Side to trim.
- maxDepth
- Maximum allowed depth to keep.
Rückgabe: Removed orders from trimmed levels.
UpdateLevel(Sides, decimal, decimal)
Update volume at a price level (for market quotes).
- side
- Side to update.
- price
- Price level to update.
- volume
- New market volume at the level.