processData: Import CSV file.

Description Usage Arguments Details Value Author(s) Examples

View source: R/data.R

Description

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

Usage

1
processData(csv.file)

Arguments

csv.file

Location of CSV file to import

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

volume

Remaining order volume

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)

Example output

Warning messages:
1: In removeDuplicates(events) :
  removed 21 duplicate order cancellations: 65596120 65596357 65596676 65597006 65597373 65600644 65600735 65602237 65602778 65602840 65603803 65607113 65608575 65609615 65611337 65611587 65611670 65612318 65614640 65616313 65618531
2: In setOrderTypes(events, trades) : could not identify 356 orders

obAnalytics documentation built on May 1, 2019, 7:04 p.m.