This package implements limit order book reconstruction.
This class represents an order book reconstruction.
- Returns
Market
Create an order book reconstruction.
Function
An event listener to be called when an order book is updated. The listener
receives an UpdateEvent
.
Function
An event listener to be called when a trade takes place. The listener receives
a TradeEvent
.
- instrument
Number
|String
- Returns
OrderBook
Open an order book.
- orderId
Number
|String
- Returns
Order
orundefined
Find an order.
- instrument
Number
|String
- orderId
Number
|String
- side
"B"
|"S"
- price
Number
- size
Number
Add an order to an order book.
An update event is triggered.
If the order book for the instrument is closed or the order identifier is known, do nothing.
- orderId
Number
|String
- size
Number
Modify an order in the order book. The order will retain its time priority. If the new size is zero, the order is deleted from the order book.
An update event is triggered.
If the order identifier is unknown, do nothing.
- orderId
Number
|String
- quantity
Number
- price
Number
Execute a quantity of an order in an order book. If the remaining quantity reaches zero, the order is deleted from the order book.
A trade event and an update event are triggered.
If the order identifier is unknown, do nothing.
- orderId
Number
|String
- quantity
Number
Cancel a quantity of an order in an order book. If the remaining quantity reaches zero, the order is deleted from the order book.
An update event is triggered.
If the order identifier is unknown, do nothing.
- orderId
Number
|String
Delete an order from an order book.
An update event is triggered.
If the order identifier is unknown, do nothing.
This class represents an order book.
Number
|String
The instrument.
- Returns
PriceLevel
orundefined
Get the best bid level.
- Returns
PriceLevel
orundefined
Get the best ask level.
- Returns
Iterator
Get the bid levels as a sequence of PriceLevel
instances.
- Returns
Iterator
Get the ask levels as a sequence of PriceLevel
instances.
This class represents an order.
OrderBook
The order book.
Number
The order price.
"B"
|"S"
The order side.
Number
The remaining quantity.
This class represents a price level.
Number
The price.
Number
The size.
This class represents an order book update.
OrderBook
The order book.
Boolean
True if the best bid and offer (BBO) has changed, otherwise false.
This class represents a trade that has taken place.
OrderBook
The order book.
"B"
|"S"
The side of the incoming order.
Number
The trade price.
Number
The trade size.