processData: Import CSV file.

Description Usage Arguments Details Value Author(s) Examples

Description

Imports and performs preprocessing of limit order data contained in a CSV.

Usage

1
processData(csv.file, price.digits = 2, volume.digits = 8)

Arguments

csv.file

Location of CSV file to import

price.digits

an integer indicating the number of decimal places in 'price' column of the CSV file

volume.digits

an integer indicating the number of decimal places in 'volume' column of the CSV file

Details

The CSV file is expected to contain 7 columns:

id

Numeric limit order unique identifier

timestamp

Time in milliseconds when event received locally

exchange.timestamp

Time in milliseconds when order first created on the exchange

price

Price level of order event. It will be rounded by round(price, price.digits)

volume

Remaining order volume. It will be rounded by round(price, volume.digits)

action

Event type (see below)

direction

Side of order book (bid or ask)

action describes the limit order life-cycle:

created

The limit order has been created

modified

The limit order has been modified (partial fill)

deleted

The limit order was deleted. If the remaining volume is 0, the order has been filled.

An example dataset returned from this function can be seen in lob.data which is the result of processing the example data included in the inst/extdata directory of this package.

Value

A list containing 4 data frames:

events

Limit order events.

trades

Inferred trades (executions).

depth

Order book price level depth through time.

depth.summary

Limit order book summary statistics.

Author(s)

phil

Examples

1
2
3
4
5
6
## Not run: 

csv.file <- system.file("extdata", "orders.csv.xz", package="obAnalytics")
lob.data <- processData(csv.file)

## End(Not run)

phil8192/ob-analytics documentation built on May 25, 2019, 2:56 a.m.