Skip to content
R package intended for visualisation, analysis and reconstruction of limit order book data
R Makefile
Branch: master
Clone or download
phil8192 Merge pull request #30 from petr-fedorov/master
Correct price labels for cheap (less than $1) curriencies
Latest commit 97d1c08 Mar 3, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
R Correct price labels for cheap (less than $1) curriencies Mar 2, 2019
man Correct price labels for cheap (less than $1) curriencies Mar 2, 2019
tests fixes #12 Oct 12, 2015
vignettes minor Nov 11, 2016
.Rbuildignore platform test Jan 24, 2016
.travis.yml fixes #12 Oct 12, 2015
DESCRIPTION add Petr Fedorov as contributor and update docs Oct 9, 2018 platform test Jan 24, 2016
NAMESPACE remove logging Oct 28, 2016
ob-analytics.png minor Nov 11, 2016 - Jan 24, 2016


Project Status: Active – The project has reached a stable, usable state and is being actively developed. Build Status Coverage Status CRAN Downloads License

Limit Order Book event processing and visualisation.

"limit order book analytics"

obAnalytics is an R package intended for visualisation and analysis of limit order data. The package is experimental and is based on the R code used to create the visualisations in this Limit Order Book Visualisation article.





if(!require("devtools")) install.packages("devtools")

Environment settings

Due to the large number of columns in the example data, it is recommended to set the display width to make the most use of the display. It is also recommended to set digits.secs=3 and scipen=999 in order to display timestamps and fractions nicely. This can be achieved as follows:

max.cols <- Sys.getenv("COLUMNS")
options(width=if(max.cols != "") max.cols else 80, scipen=999, digits.secs=3)

Example use

Preprocessed limit order data from the inst/extdata directory has been included in the package. The data, taken from a Bitcoin exchange on 2015-05-01, consists of 50,393 limit order events and 482 trades occuring from midnight up until ~5am. To use the data, attach it to the environment:


The data structure contains 4 data.frames describing limit order events, trades, depth and summary statistics. All of which are described in detail in the package documentation. To visualise all of the example order book data, use the plotPriceLevels function:

with(, {
  spread <- getSpread(depth.summary)
  plotPriceLevels(depth, spread, volume.scale=10^-8,

Web app

An interactive interface making use of this package is available in the shiny-ob-analytics respository.


Example use documentation has been created in R Markdown (see vignettes) directory. knitr is used to generate vignettes. roxygen2 is used to generate the pdf manual from code comments.

Example use of obAnalytics package (html)

An end-to-end walk-through to demonstrate the main features and functionality of the package is available here:

Example use (pdf)


In addition to online ?help, package data and function documentation is available in the form of a manual:


GPL (>= 2)

You can’t perform that action at this time.