joshuaulrich / quantmod

Quantitative Financial Modelling Framework
http://www.quantmod.com/
GNU General Public License v3.0
798 stars 219 forks source link

getSymbols does not retrieve Yahoo financial data #367

Closed ghost closed 1 year ago

ghost commented 1 year ago

Yahoo may implement some changes on its financial data and the

f = getSymbols('SPY', src = 'yahoo', auto.assign = FALSE)

does not retrieve any data. This only happens since yesterday.

Would you please review whether the getSymbols() needs update too? The python added a decryption function in the pandas_datareader/yahoo/daily.py to make it work again. See https://github.com/pydata/pandas-datareader/issues/952.

Any help is greatly appreciated. Thank you very much.

joshuaulrich commented 1 year ago

Thanks for the report. Can you please provide the output of sessionInfo()?

ghost commented 1 year ago

thank you very much. here is the sessionInfo(). The quantmod is 0.4.20.

thank you again for your review.

the error message is as follows:


f = na.omit(getSymbols(ticker, src = 'yahoo', from = start,auto.assign=F))

Warning: GDX download failed; trying again.
Error in getSymbols.yahoo(Symbols = "GDX", env = <environment>, verbose = FALSE,  : 
  Unable to import “GDX”.
GDX download failed after two attempts. Error message:
Timeout was reached: [query1.finance.yahoo.com] Resolving timed out after 10002 milliseconds

sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 9 (stretch)

Matrix products: default
BLAS/LAPACK: /usr/lib/libopenblasp-r0.2.19.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8       
 [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=C             
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] AlphaVantageClient_0.0.1   magrittr_1.5               pipeR_0.6.1.3             
 [4] ggplot2_3.2.1              reshape2_1.4.3             latticeExtra_0.6-28       
 [7] RColorBrewer_1.1-2         lattice_0.20-38            caTools_1.17.1.3          
[10] lubridate_1.7.4            data.table_1.12.8          DSTrading_1.0             
[13] quantstrat_0.16.9          foreach_1.4.7              blotter_0.15.0            
[16] PerformanceAnalytics_1.5.3 FinancialInstrument_1.3.1  inline_0.3.15             
[19] Rcpp_1.0.3                 SIT_2021.01.10             SIT.date_0.1              
[22] quantmod_0.4.20            TTR_0.23-5                 xts_0.12.1.2              
[25] zoo_1.8-6                 

loaded via a namespace (and not attached):
 [1] pillar_1.4.2     compiler_3.6.1   plyr_1.8.5       bitops_1.0-6     iterators_1.0.12
 [6] tools_3.6.1      boot_1.3-22      tibble_2.1.3     lifecycle_0.1.0  gtable_0.3.0    
[11] pkgconfig_2.0.3  rlang_0.4.2      rstudioapi_0.10  curl_4.3         withr_2.1.2     
[16] dplyr_0.8.3      stringr_1.4.0    tidyselect_0.2.5 grid_3.6.1       glue_1.3.1      
[21] R6_2.4.1         purrr_0.3.3      scales_1.1.0     codetools_0.2-16 MASS_7.3-51.4   
[26] assertthat_0.2.1 colorspace_1.4-1 quadprog_1.5-8   stringi_1.4.3    lazyeval_0.2.2  
[31] munsell_0.5.0    crayon_1.3.4    ```
joshuaulrich commented 1 year ago

This is a timeout issue, which is likely caused by the user's internet connection and/or an issue with the Yahoo Finance servers. Either way, I can't fix it via changes in quantmod, so I'm closing.