Learn R Programming

highfrequency (version 0.7.0.1)

exchangeHoursOnly: Extract data from an xts object for the Exchange Hours Only

Description

The function returns data within exchange trading hours "dayBegin" and "dayEnd". By default, dayBegin and dayEnd are set to "09:30:00" and "16:00:00" respectively (see Brownlees and Gallo (2006) for more information on good choices for these arguments).

Usage

exchangeHoursOnly(data, dayBegin = "09:30:00", dayEnd = "16:00:00")

Arguments

data

a data.table or xts object containing the time series data. Multiple days of input are allowed.

dayBegin

character in the format of \"HH:MM:SS\", specifying the starting hour, minute and second of an exchange trading day.

dayEnd

character in the format of \"HH:MM:SS\^", specifying the closing hour, minute and second of an exchange trading day.

Value

xts or data.table object depending on input

References

Brownlees, C.T. and Gallo, G.M. (2006). Financial econometric analysis at ultra-high frequency: Data handling concerns. Computational Statistics & Data Analysis, 51, pages 2232-2245.

Examples

Run this code
# NOT RUN {
exchangeHoursOnly(sampleTDataRawMicroseconds)
# }

Run the code above in your browser using DataLab