jonathancornelissen / highfrequency

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.
147 stars 63 forks source link

exchangeHoursOnly doesn't work for xts #96

Open jacekszandula opened 1 year ago

jacekszandula commented 1 year ago

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

onnokleen commented 1 year ago

Indeed, it will be fixed in the next release.

onnokleen commented 11 months ago

@kboudt Can you close this issue as the new version is on CRAN?