Lean  $LEAN_TAG$
QuantConnect.Brokerages.DefaultOrderBook Class Reference

Represents a full order book for a security. It contains prices and order sizes for each bid and ask level. The best bid and ask prices are also kept up to date. More...

Inheritance diagram for QuantConnect.Brokerages.DefaultOrderBook:
[legend]

Public Member Functions

 DefaultOrderBook (Symbol symbol)
 Initializes a new instance of the DefaultOrderBook class More...
 
void Clear ()
 Clears all bid/ask levels and prices. More...
 
void UpdateBidRow (decimal price, decimal size)
 Updates or inserts a bid price level in the order book More...
 
void UpdateAskRow (decimal price, decimal size)
 Updates or inserts an ask price level in the order book More...
 
void RemoveBidRow (decimal price)
 Removes a bid price level from the order book More...
 
void RemoveAskRow (decimal price)
 Removes an ask price level from the order book More...
 
void RemovePriceLevel (decimal priceLevel)
 Common price level removal method More...
 
- Public Member Functions inherited from QuantConnect.Brokerages.IOrderBookUpdater< decimal, decimal >
void UpdateBidRow (K price, V size)
 Updates or inserts a bid price level in the order book More...
 
void UpdateAskRow (K price, V size)
 Updates or inserts an ask price level in the order book More...
 
void RemoveBidRow (K price)
 Removes a bid price level from the order book More...
 
void RemoveAskRow (K price)
 Removes an ask price level from the order book More...
 

Properties

SortedDictionary< decimal, decimal > Bids = new SortedDictionary<decimal, decimal>() [get]
 Represents bid prices and sizes More...
 
SortedDictionary< decimal, decimal > Asks = new SortedDictionary<decimal, decimal>() [get]
 Represents ask prices and sizes More...
 
Symbol Symbol [get]
 Represents a unique security identifier of current Order Book More...
 
decimal BestBidPrice [get]
 The best bid price More...
 
decimal BestBidSize [get]
 The best bid size More...
 
decimal BestAskPrice [get]
 The best ask price More...
 
decimal BestAskSize [get]
 The best ask size More...
 

Events

EventHandler< BestBidAskUpdatedEventArgsBestBidAskUpdated
 Event fired each time BestBidPrice or BestAskPrice are changed More...
 
- Events inherited from QuantConnect.Brokerages.IOrderBookUpdater< decimal, decimal >
EventHandler< BestBidAskUpdatedEventArgsBestBidAskUpdated
 Event fired each time BestBidPrice or BestAskPrice are changed More...
 

Detailed Description

Represents a full order book for a security. It contains prices and order sizes for each bid and ask level. The best bid and ask prices are also kept up to date.

Definition at line 27 of file DefaultOrderBook.cs.

Constructor & Destructor Documentation

◆ DefaultOrderBook()

QuantConnect.Brokerages.DefaultOrderBook.DefaultOrderBook ( Symbol  symbol)

Initializes a new instance of the DefaultOrderBook class

Parameters
symbolThe symbol for the order book

Definition at line 115 of file DefaultOrderBook.cs.

Member Function Documentation

◆ Clear()

void QuantConnect.Brokerages.DefaultOrderBook.Clear ( )

Clears all bid/ask levels and prices.

Definition at line 123 of file DefaultOrderBook.cs.

◆ UpdateBidRow()

void QuantConnect.Brokerages.DefaultOrderBook.UpdateBidRow ( decimal  price,
decimal  size 
)

Updates or inserts a bid price level in the order book

Parameters
priceThe bid price level to be inserted or updated
sizeThe new size at the bid price level

Definition at line 142 of file DefaultOrderBook.cs.

◆ UpdateAskRow()

void QuantConnect.Brokerages.DefaultOrderBook.UpdateAskRow ( decimal  price,
decimal  size 
)

Updates or inserts an ask price level in the order book

Parameters
priceThe ask price level to be inserted or updated
sizeThe new size at the ask price level

Definition at line 163 of file DefaultOrderBook.cs.

◆ RemoveBidRow()

void QuantConnect.Brokerages.DefaultOrderBook.RemoveBidRow ( decimal  price)

Removes a bid price level from the order book

Parameters
priceThe bid price level to be removed

Definition at line 183 of file DefaultOrderBook.cs.

Here is the caller graph for this function:

◆ RemoveAskRow()

void QuantConnect.Brokerages.DefaultOrderBook.RemoveAskRow ( decimal  price)

Removes an ask price level from the order book

Parameters
priceThe ask price level to be removed

Definition at line 204 of file DefaultOrderBook.cs.

Here is the caller graph for this function:

◆ RemovePriceLevel()

void QuantConnect.Brokerages.DefaultOrderBook.RemovePriceLevel ( decimal  priceLevel)

Common price level removal method

Parameters
priceLevel

Definition at line 225 of file DefaultOrderBook.cs.

Here is the call graph for this function:

Property Documentation

◆ Bids

SortedDictionary<decimal, decimal> QuantConnect.Brokerages.DefaultOrderBook.Bids = new SortedDictionary<decimal, decimal>()
getprotected

Represents bid prices and sizes

Definition at line 38 of file DefaultOrderBook.cs.

◆ Asks

SortedDictionary<decimal, decimal> QuantConnect.Brokerages.DefaultOrderBook.Asks = new SortedDictionary<decimal, decimal>()
getprotected

Represents ask prices and sizes

Definition at line 43 of file DefaultOrderBook.cs.

◆ Symbol

Symbol QuantConnect.Brokerages.DefaultOrderBook.Symbol
get

Represents a unique security identifier of current Order Book

Definition at line 48 of file DefaultOrderBook.cs.

◆ BestBidPrice

decimal QuantConnect.Brokerages.DefaultOrderBook.BestBidPrice
get

The best bid price

Definition at line 59 of file DefaultOrderBook.cs.

◆ BestBidSize

decimal QuantConnect.Brokerages.DefaultOrderBook.BestBidSize
get

The best bid size

Definition at line 73 of file DefaultOrderBook.cs.

◆ BestAskPrice

decimal QuantConnect.Brokerages.DefaultOrderBook.BestAskPrice
get

The best ask price

Definition at line 87 of file DefaultOrderBook.cs.

◆ BestAskSize

decimal QuantConnect.Brokerages.DefaultOrderBook.BestAskSize
get

The best ask size

Definition at line 101 of file DefaultOrderBook.cs.

Event Documentation

◆ BestBidAskUpdated

EventHandler<BestBidAskUpdatedEventArgs> QuantConnect.Brokerages.DefaultOrderBook.BestBidAskUpdated

Event fired each time BestBidPrice or BestAskPrice are changed

Definition at line 53 of file DefaultOrderBook.cs.


The documentation for this class was generated from the following file: