Is tq_get() down from tidyquant?
mlozanoqf opened this issue · 7 comments
Hello. The following code:
aapl_prices <- tq_get("AAPL", get = "stock.prices", from = " 1990-01-01")
aapl_prices
Leads to:
“Warning message: “x = 'AAPL', get = 'stock.prices': Error in new.session(): Could not establish session after 5 attempts.”
<NA>
The quantmod
package has a similar issue, but I guess the solution proposed by Joshua Ulrich does not apply for tidyquant
.
Regards.
@mdancho84 This is an issue with quantmod that Josh Ulrich is fixing. Will Tidyquant need a patch to this dependency?
I added the following according to Joshua Ulrich:
install.packages("quantmod")
library(quantmod)
remotes::install_github("joshuaulrich/xts", force = TRUE)
remotes::install_github("joshuaulrich/quantmod@358-getsymbols-new.session")
Then reset my session and now tq_get()
works fine. I did not know tidyquant
and quantmod
were kind of related. I prefer tidyquant
.
tq_get does not work with large number of tickers but getSymbols from Quantmod works I believe because it adds 1 second pause between requests.
x = 'GOOG', get = 'stock.prices': Error in getSymbols.yahoo(Symbols = "GOOG", env = , verbose = FALSE, : Unable to import �GOOG�.
GOOG download failed after two attempts. Error message:
HTTP error 401.
You guys just need to upgrade quantmod to the patch that fixes this issue.
remotes::install_github("joshuaulrich/quantmod@358-getsymbols-new.session")
And FYI - tidyquant use's quantmod so if quantmod works, then tidyquant works.
This is fixed.
remotes::install_github("joshuaulrich/quantmod@358-getsymbols-new.session")
CRAN has quantmod
version 0.4.20, which fixes the issue. Simply update quantmod
if this issue affects you./