Description Usage Arguments Details Value Author(s) Examples
View source: R/order-book-reconstruction.R
Given a set of events
, reconstructs a limit order book for a
specific point in time.
1 2 |
events |
Limit order |
tp |
Time point to re-construct order book at. |
max.levels |
Max number of price levels to return. |
bps.range |
Max depth to return +- BPS from best bid/ask. |
min.bid |
Min bid to return. |
max.ask |
Max ask to return. |
An order book consists of 2 sides: bids and asks, an example of which is shown below:
id | price | volume | liquidity | bps |
65613703 | 236.58 | 910229141 | 6341547077 | 2.11 |
65613655 | 236.56 | 1320000000 | 5431317936 | 1.26 |
65613700 | 236.55 | 1320000000 | 4111317936 | 0.84 |
65613698 | 236.54 | 1600000000 | 2791317936 | 0.42 |
65613712 | 236.53 | 1191317936 | 1191317936 | 0.00 |
- | - | - | - | - |
65613225 | 236.36 | 16154172 | 16154172 | 0.00 |
65613681 | 236.31 | 200000000 | 216154172 | 2.11 |
65613220 | 236.30 | 100000000 | 316154172 | 2.53 |
65612978 | 236.28 | 100000000 | 416154172 | 3.38 |
65612388 | 236.17 | 100000000 | 516154172 | 8.03 |
Limit Order Book structure. A list containing 3 fields:
Timestamp the order book was reconstructed for.
A data.frame containing the Ask side of the order book.
A data.frame containing the Bid side of the order book.
The bids and asks data consists of the following:
Limit order Id.
Last modification time to limit order.
Time at which order was placed in order book.
Limit order price.
Limit orer volume.
Cumulative sum of volume from best bid/ask up until price.
Distance (in BPS) of order from best bid/ask.
Both the bids and asks data are ordered by descending price.
phil
1 2 | tp <- as.POSIXct("2015-05-01 04:25:15.342", tz="UTC")
orderBook(lob.data$events, max.levels=5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.