Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Error in min(selection):max(selection) while using the vol function #80

Open
MislavSag opened this issue Sep 17, 2021 · 2 comments
Open

Comments

@MislavSag
Copy link

Hi,

I am trying to use businessTimeAggregation function with vol (volatility) as measure:

library(QuantTools)
library(highfrequency)

# import data and cleaning
ticks <- get_finam_data("AAPL", as.Date("2021-09-01"), as.Date("2021-09-02"), "tick")
setnames(ticks, c("DT", "PRICE", "SIZE"))
ticks$SYMBOL <- "AAPL"
ticks_cleaned <- tradesCleanup(tDataRaw = ticks)
ticks_cleaned <- ticks_cleaned$tData

# aggreagtion
vol_bars <- businessTimeAggregation(ticks_cleaned, measure = "vol")

but got an error:

Error in min(selection):max(selection) : 
  result would be too long a vector
In addition: Warning messages:
1: In detPer(mR, rData = rData, options = options) :
  Periodicity estimation is unstable when the sample data contains less than 50 days. The quality of results may vary
2: In min(selection) : no non-missing arguments to min; returning Inf
3: In max(selection) : no non-missing arguments to max; returning -Inf

I have also tried with more than 50days of data, but got the same error.

@onnokleen
Copy link
Contributor

The QuantTools package is not supported anymore but I think I found your error. It could be that there are too many zero-returns at the same time across days. I'll improve the error messages.

@MislavSag
Copy link
Author

Hello, thanks for the answer. This is an old issue, but I will try again soon since I have just starterd to work with highfrequency package few days before, after some time.... I want close an issue, since you said you will add some error messages...

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants