We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tq_get()
Most tq_get sources return data oldest to newest, and many functions rely on this format. Quandl data is not returned that way.
tq_get
(Thanks to Rick for the example)
library(tidyquant) CL_F1 = tq_get('CHRIS/CME_GC1', get = 'quandl') ggplot(subset(CL_F1,date > '2016-01-01'),aes(x = date, y = settle)) + geom_line() + geom_ma(ma_fun = EMA, n = 126)
The EMA is thrown off and calculated backwards because of this. Arrange quandl data using something like:
CL_F1_multi = tq_get(x = c('CHRIS/CME_GC1', 'CHRIS/CME_C10'), get = 'quandl') CL_F1_multi_sorted <- CL_F1_multi %>% mutate(symbol = forcats::as_factor(symbol)) %>% arrange(symbol, date) %>% mutate(symbol = as.character(symbol))
Converting to factor will take care of arrange attempting to order symbol alphabetically and ruining the user defined order.
arrange
EDIT: Going to overwrite the Quandl option order = "asc" instead.
order = "asc"
The text was updated successfully, but these errors were encountered:
c88a22c
Merge pull request #35 from business-science/fix_quandl_order
eacedcb
Fixes #32 - Quandl now returns data oldest to newest.
No branches or pull requests
Most
tq_get
sources return data oldest to newest, and many functions rely on this format. Quandl data is not returned that way.(Thanks to Rick for the example)
The EMA is thrown off and calculated backwards because of this. Arrange quandl data using something like:
Converting to factor will take care of
arrange
attempting to order symbol alphabetically and ruining the user defined order.EDIT: Going to overwrite the Quandl option
order = "asc"
instead.The text was updated successfully, but these errors were encountered: