joshuaulrich / quantmod

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

stockSymbols() no longer works #275

Closed datafan11 closed 4 years ago

datafan11 commented 4 years ago

Description

stockSymbols() no longer works. Nasdaq.com redesigned their website. Please fix if you have time. The function is incredibly convenient. Thanks.

Note if you change the "www" in https://www.nasdaq.com/ to "old" then it appears to work. Don't know how long the "old" site will be available.

E.g., https://www.nasdaq.com/screening/companies-by-name.aspx?letter=0&exchange=AMEX&render=download

to

https://old.nasdaq.com/screening/companies-by-name.aspx?letter=0&exchange=AMEX&render=download

Expected behavior

Should return a list of US stock symbols.

Minimal, reproducible example

library(quantmod) 
symbols<-list()
symbols <- stockSymbols()
Fetching AMEX symbols...
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
  cannot open URL 'https://www.nasdaq.com/screening/companies-by-name.aspx?letter=0&exchange=AMEX&render=download': HTTP status was '404 Not Found'

Session Info

[R version 3.4.3 (2017-11-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

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

other attached packages:
[1] anytime_0.3.3     data.table_1.12.2 dplyr_0.8.0.1     jsonlite_1.6      ROAuth_0.9.6      quantmod_0.4-15  
[7] TTR_0.23-4        xts_0.11-2        zoo_1.8-5        

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.1         magrittr_1.5       tidyselect_0.2.5   lattice_0.20-38    R6_2.4.0           rlang_0.3.4       
 [7] tools_3.4.3        grid_3.4.3         RApiDatetime_0.0.4 digest_0.6.18      assertthat_0.2.1   tibble_2.1.1      
[13] crayon_1.3.4       purrr_0.3.2        bitops_1.0-6       RCurl_1.95-4.12    curl_3.3           glue_1.3.1        
[19] compiler_3.4.3     pillar_1.4.2       pkgconfig_2.0.2 ]
joshuaulrich commented 4 years ago

Thanks for the report. I'm closing this because stockSymbols() is in TTR. This is a duplicate of https://github.com/joshuaulrich/TTR/issues/83.