matchTrades: Construct trades data.table.

Description Usage Arguments Value Author(s) Examples

View source: R/trades.R

Description

Given event data which has been pre-matched with maker/taker event ids, this function will return a data.table containing all matched executions.

Usage

1

Arguments

events

Limit order event data with assigned maker/taker event ids.

Value

A data.frame describing marketable order executions of the following form:

timestamp

min(maker timestamp, taker timestamp) (first time we learned of this trade)

price

Maker price (taker limit price can cross the book.)

volume

Lifted/traded volume

direction

Trade direction (side of the aggressor/taker)

maker.event.id

event.id corresponding to row in events data

taker.event.id

event.id corresponding to tow in events data

maker

Maker limit order id

taker

Taker limit order id

A market limit order (marketable) is first a taker and then becomes a maker after landing in the order book before it's limit is reached.

A market order is always a taker: it's volume will be filled before it's limit is reached.

Grouping executions by maker/taker can be used to analyse market impact events.

Author(s)

phil

Examples

1
2
3
4
5
6
7
8
## Not run: 

csv.file <- system.file("extdata", "orders.csv.xz", package="obAnalytics")
events <- loadEventData(csv.file)
events <- eventMatch(events)
trades <- matchTrades(events)

## End(Not run)

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