Recreating the LOB (limit order book)

Version 1.4 of GetHFData adds functions for recreating the LOB (limit order book) from the order data. The LOB is recreated by sorting all trading orders (buy and sell) and matching them whenever there is a match of prices.

Simulating the LOB is a recursive and computer intensive problem. The current code is not optimized for speed and it may take a long time to process even a small set of financial orders.

Here's an example of usage:

library(GetHFData)

first.time <- '10:00:00'
last.time <- '17:00:00'

first.date <- '2016-08-18' 
last.date <- '2016-08-18'

type.output <- 'raw' # aggregates data 

my.assets <- 'PETR4F' 
type.matching <- 'exact' 
type.market = 'equity-odds' 
type.data <- 'orders' # order data

df.out <- ghfd_get_HF_data(my.assets =my.assets, 
                           type.data= type.data,
                           type.matching = type.matching,
                           type.market = type.market,
                           first.date = first.date,
                           last.date = last.date,
                           first.time = first.time,
                           last.time = last.time,
                           type.output = type.output)

df.lob <- ghfd_build_lob(df.out)


Try the GetHFData package in your browser

Any scripts or data that you put into this service are public.

GetHFData documentation built on May 1, 2019, 10:19 p.m.