Learn R Programming

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

highfrequency (version 0.7.0)

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,419

Version

0.7.0

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Kris Boudt

Last Published

September 15th, 2020

Functions in highfrequency (0.7.0)

RV

An estimator of realized variance.
SP500RM

SP500 Realized Measures calculated with 5 minute sampling
RTQ

Calculate the realized tripower quarticity
HEAVYmodel

HEAVY Model estimation
BNSjumpTest

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

HAR model estimation (Heterogeneous Autoregressive model for Realized volatility)
AJjumpTest

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

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

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

ReMeDI This function estimates the auto-covariance of market-microstructure noise
autoSelectExchangeTrades

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

Jiang and Oomen (2008) tests for the presence of jumps in the price series.
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.
getPrice

Get price column(s) from a timeseries
businessTimeAggregation

Business time aggregation
getAlphaVantageData

Get high frequency data from Alpha Vantage
exchangeHoursOnly

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

medRV
leadLag

Lead-Lag estimation
listAvailableKernels

Available Kernels
mergeQuotesSameTimestamp

Merge multiple quote entries with the same time stamp
autoSelectExchangeQuotes

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

Aggregate a data.table or xts object containing quote data
minRV

minRV
rHYCov

Hayashi-Yoshida Covariance
mukp

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

highfrequency: Tools for Highfrequency Data Analysis
intradayJumpTest

Intraday jump tests
aggregateTS

Aggregate a time series
getTradeDirection

Get trade direction
rKernelCov

Realized Covariance: Kernel
TSCov_bi

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

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

Aggregate a time series but keep first and last observation
makeReturns

Compute log returns
listCholCovEstimators

Utility function listing the available estimators for the CholCov estimation
makePsd

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

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

ReMeDI tuning parameter function to choose the tuning parameter, kn in ReMeDI estimation
quotesCleanup

Cleans quote data
rAVGCov

Realized Covariance: Average Subsample
rCholCov

rCholCov positive semi-definite covariance estimation using the CholCov algorithm
rankJumpTest

Rank jump test
rQuar

Realized quarticity of highfrequency return series.
minRQ

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

Merge multiple transactions with the same time stamp
rCov

Realized Covariance
medRQ

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

Match trade and quote data
realizedLibrary

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

Realized BiPower Covariance
rRTSCov

Robust two time scale covariance estimation
rKurt

Realized kurtosis of highfrequency return series.
rBeta

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

Delete transactions with unlikely transaction prices
rMPV

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

Realized Semicovariance
lltc

LLTC Data
noZeroPrices

Delete the observations where the price is zero
rSV

Realized semivariance of highfrequency return series.
rmTradeOutliersUsingQuotes

Delete transactions with unlikely transaction prices
sampleTDataMicroseconds

Sample of cleaned trades for stock XXX for 2 days
refreshTime

Synchronize (multiple) irregular timeseries by refresh time
tradesCleanupUsingQuotes

Perform a final cleaning procedure on trade data
rTSCov

Two time scale covariance estimation
rmLargeSpread

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

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

Threshold Covariance
rOWCov

Realized Outlyingness Weighted Covariance
sampleTDataRaw

Sample of raw trades for stock XXX for 1 day
noZeroQuotes

Delete the observations where the bid or ask is zero
rmNegativeSpread

Delete entries for which the spread is negative
rmOutliersQuotes

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

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

Realized quad-power variation of highfrequency return series.
selectExchange

Retain only data from a single stock exchange
sampleQData

Sample of cleaned quotes for stock XXX for 1 day
spotDrift

Spot Drift Estimation
rSkew

Realized skewness of highfrequency return series.
sampleQDataRawMicroseconds

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

Delete entries with abnormal Sale Condition.
rTPVar

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

Sample of raw quotes for stock XXX for 1 day
sampleTDataRawMicroseconds

Sample of raw trades for stock XXX for 2 days
sampleReal5MinPrices

Sample of imaginary price data for 61 days
sbux

Starbucks Data
tradesCleanup

Cleans trade data
spotVol

Spot volatility estimation
sample5MinPrices

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

Sample returns data
sampleTData

Sample of cleaned trades for stock XXX for 1 day