Learn R Programming

highfrequency (version 0.7.0.1)

matchTradesQuotes: Match trade and quote data

Description

Function matches the trades and quotes and returns an xts-object containing both.

Usage

matchTradesQuotes(tData, qData, adjustment = 2)

Arguments

tData

data.table or xts-object containing the trade data (multiple days possible).

qData

data.table or xts-object containing the quote data (multiple days possible).

adjustment

numeric, number of seconds the quotes are registered faster than the trades (should be round and positive). Based on the research of Vergote (2005), we set 2 seconds as the default.

Value

data.table or xts-object containing the matched trade and quote data

References

Vergote, O. (2005). How to match trades and quotes for NYSE stocks? K.U.Leuven working paper.

Examples

Run this code
# NOT RUN {
# match the trade and quote data
tqData <- matchTradesQuotes(sampleTData, sampleQData)
head(tqData)
# multi-day input allowed
tqData <- matchTradesQuotes(sampleTDataMicroseconds, sampleQDataMicroseconds)
# }

Run the code above in your browser using DataLab