Learn R Programming

⚠️There's a newer version (1.0.1) of this package.Take me there.

highfrequency (version 0.6.5)

Tools for Highfrequency Data Analysis

Description

Provide functionality to manage, clean and match highfrequency trades and quotes data, calculate various liquidity measures, estimate and forecast volatility, detect price jumps and investigate microstructure noise and intraday periodicity.

Copy Link

Version

Install

install.packages('highfrequency')

Monthly Downloads

1,540

Version

0.6.5

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

April 15th, 2020

Functions in highfrequency (0.6.5)

RTQ

Calculate the realized tripower quarticity
SP500RM

SP500 Realized Measures calculated with 5 minute sampling
TSCov_bi

rvKernel <- function(x, # Tick Data kernel.type = "rectangular", # Kernel name (or number) kernel.param = 1, # Kernel parameter (usually lags) kernel.dofadj = TRUE, # Kernel Degree of freedom adjustment align.by = "seconds", # Align the tick data to [seconds|minutes|hours] align.period = 1) # Align the tick data to this many [seconds|minutes|hours] # Multiday adjustment: multixts <- multixts(x) if (multixts == TRUE) result <- apply.daily(x, rv.kernel,kernel.type,kernel.param,kernel.dofadj, align.by, align.period, cts, makeReturns) return(result) else #Daily estimation: align.period <- .getAlignPeriod(align.period, align.by) cdata <- .convertData(x, cts = cts, makeReturns = makeReturns) x <- cdata$data x <- .alignReturns(x, align.period) type <- kernelCharToInt(kernel.type) kernelEstimator(as.double(x), as.double(x), as.integer(length(x)), as.integer(kernel.param), as.integer(ifelse(kernel.dofadj, 1, 0)), as.integer(type), ab = double(kernel.param + 1), ab2 = double(kernel.param + 1))
JOjumptest

Jiang and Oomen (2008) tests for the presence of jumps in the price series.
getPrice

Get price column(s) from a timeseries
MRC

Modulated Realized Covariance (MRC): Return univariate or multivariate preaveraged estimator.
RV

An estimator of realized variance.
heavyModel

HEAVY Model estimation
hasQty

Check for Trade, Bid, and Ask/Offer (BBO/TBBO), Quantity, and Price data
aggregateTrades

Aggregate a data.table or xts object containing trades data
harModel

HAR model estimation (Heterogeneous Autoregressive model for Realized volatility)
highfrequency-package

highfrequency: Tools for Highfrequency Data Analysis
getTradeDirection

Get trade direction
noZeroPrices

Delete the observations where the price is zero
rHYCov

Hayashi-Yoshida Covariance
makeReturns

Compute log returns
AJjumptest

Ait-Sahalia and Jacod (2009) tests for the presence of jumps in the price series.
ivInference

Function returns the value, the standard error and the confidence band of the integrated variance (IV) estimator.
minRQ

An estimator of integrated quarticity from applying the minimum operator on blocks of two returns.
rKernelCov

Realized Covariance: Kernel
listAvailableKernels

Available Kernels
mergeQuotesSameTimestamp

Merge multiple quote entries with the same time stamp
matchTradesQuotes

Match trade and quote data
exchangeHoursOnly

Extract data from an xts object for the Exchange Hours Only
minRV

minRV
mergeTradesSameTimestamp

Merge multiple transactions with the same time stamp
rmNegativeSpread

Delete entries for which the spread is negative
mukp

## mukp: to use when p,k different from range [4,6]
sample_real5minprices

Sample of imaginary price data for 61 days
rRTSCov

Robust two time scale covariance estimation
BNSjumptest

Barndorff-Nielsen and Shephard (2006) tests for the presence of jumps in the price series.
rmOutliersQuotes

Delete entries for which the mid-quote is outlying with respect to surrounding entries
rBeta

Realized beta: a tool in measuring risk with respect to the market.
sample_qdataraw_microseconds

Sample of raw quotes for stock XXX for 2 days measured in microseconds
getLiquidityMeasures

Compute Liquidity Measure Function returns an xts or data.table object containing 23 liquidity measures. Please see details below. Note that this assumes a regular time grid. The Lee + Ready measure uses two lags for the Tick Rule.
rQuar

Realized quarticity of highfrequency return series.
autoSelectExchangeQuotes

Retain only data from the stock exchange with the highest volume
spotDrift

Spot Drift Estimation
selectExchange

Retain only data from a single stock exchange
autoSelectExchangeTrades

Retain only data from the stock exchange with the highest trading volume
aggregatets

Aggregate a time series
medRV

medRV
medRQ

An estimator of integrated quarticity from applying the median operator on blocks of three returns.
rTSCov

Two time scale covariance estimation
refreshTime

Synchronize (multiple) irregular timeseries by refresh time
rTPVar

Realized tri-power variation estimator of quarticity for a highfrequency return series.
sample_qdata_microseconds

Sample of cleaned quotes for stock XXX for 2 days measured in microseconds
rThresholdCov

Threshold Covariance
rAVGCov

Realized Covariance: Average Subsample
rKurt

Realized kurtosis of highfrequency return series.
rCov

Realized Covariance
rBPCov

Realized BiPower Covariance
rMPV

Realized multipower variation (MPV), an estimator of integrated power variation.
sample_qdataraw

Sample of raw quotes for stock XXX for 1 day
rmLargeSpread

Delete entries for which the spread is more than "maxi" times the median spread
sample_tdataraw_microseconds

Sample of raw trades for stock XXX for 2 days
sbux

Starbucks Data
lltc

LLTC Data
noZeroQuotes

Delete the observations where the bid or ask is zero
sample_5minprices_jumps

Ten artificial time series (including jumps) for the NYSE trading days during January 2010
spotvol

Spot volatility estimation
makePsd

Returns the positive semidinite projection of a symmetric matrix using the eigenvalue method
rOWCov

Realized Outlyingness Weighted Covariance
realized_library

The realized library from the Oxford-Man Institute of Quantitative Finance
quotesCleanup

Cleans quote data
rmTradeOutliers

Delete transactions with unlikely transaction prices
rSV

Realized semivariance of highfrequency return series.
rSkew

Realized skewness of highfrequency return series.
rQPVar

Realized quad-power variation of highfrequency return series.
sample_qdata

Sample of cleaned quotes for stock XXX for 1 day
sample_returns_5min

Sample returns data
salesCondition

Delete entries with abnormal Sale Condition.
rmTradeOutliersUsingQuotes

Delete transactions with unlikely transaction prices
tradesCleanup

Cleans trade data
sample_tdata_microseconds

Sample of cleaned trades for stock XXX for 2 days
sample_tdata

Sample of cleaned trades for stock XXX for 1 day
sample_tdataraw

Sample of raw trades for stock XXX for 1 day
sample_5minprices

Ten artificial time series for the NYSE trading days during January 2010
tradesCleanupUsingQuotes

Perform a final cleaning procedure on trade data
aggregatePrice

Aggregate a time series but keep first and last observation
aggregateQuotes

Aggregate a data.table or xts object containing quote data