The highfrequency package contains an extensive toolkit for the use of highfrequency financial data in R. It contains functionality to manage, clean and match highfrequency trades and quotes data. Furthermore, it enables users to: calculate easily various liquidity measures, estimate and forecast volatility, and investigate microstructure noise and intraday periodicity.
I tried
exchangeHoursOnly(as.xts(sampleTDataRaw))
got
Error in xts(as.matrix(data[, -c("DT")]), order.by = data$DT, tzone = tzone(data$DT)) :
order.by requires an appropriate time-based object
I reviewed the exchangeHoursOnly and it seems that this part is wrong
if (inputWasXts) {
return(xts(as.matrix(data[, -c("DT")]), order.by = data$DT,
tzone = tzone(data$DT)))
}
"DT" column is removed earlier
exchangeHoursOnly doesn't work for xts
I tried exchangeHoursOnly(as.xts(sampleTDataRaw)) got Error in xts(as.matrix(data[, -c("DT")]), order.by = data$DT, tzone = tzone(data$DT)) : order.by requires an appropriate time-based object
I reviewed the exchangeHoursOnly and it seems that this part is wrong if (inputWasXts) { return(xts(as.matrix(data[, -c("DT")]), order.by = data$DT, tzone = tzone(data$DT))) } "DT" column is removed earlier