mergeTradesSameTimestamp: Merge multiple transactions with the same time stamp

View source: R/dataHandling.R

mergeTradesSameTimestampR Documentation

Merge multiple transactions with the same time stamp

Description

Merge trade entries that have the same time stamp to a single one and returns an xts or a data.table object with unique time stamps only.

Usage

mergeTradesSameTimestamp(tData, selection = "median")

Arguments

tData

an xts object containing the time series data, with one column named PRICE indicating the transaction price and one column SIZE indicating the number of shares traded.

selection

indicates how the price for a certain time stamp should be calculated in case of multiple observation for a certain time stamp. By default, selection = "median", and the median price is taken. Alternatively:

  • selection = "max.volume": use the price of the transaction with largest volume.

  • selection = "weighted.average": take the weighted average of all prices.

Value

data.table or xts object depending on input.

Note

previously this function returned the mean of the size of the merged trades (pre version 0.7 and when not using max.volume as the criterion), now it returns the sum.

Author(s)

Jonathan Cornelissen, Kris Boudt, Onno Kleen, and Emil Sjoerup.


highfrequency documentation built on Oct. 4, 2023, 5:08 p.m.