Skip to content

Commit

Permalink
fixes #246 - tq_index("SP500")
Browse files Browse the repository at this point in the history
  • Loading branch information
mdancho84 committed Aug 19, 2024
1 parent 64b2ed3 commit 58e8db3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/tq_stock_list.R
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,10 @@ index_download <- function(x, index_name) {

# Contruct download link
# OLD (< 2019-12-15): https://us.spdrs.com/site-content/xls/SPY_All_Holdings.xls
# NEW (> 2019-12-15) https://www.ssga.com/us/en/institutional/etfs/library-content/products/fund-data/etfs/us/holdings-daily-us-en-spy.xlsx
# NEW (> 2019-12-15): https://www.ssga.com/us/en/institutional/etfs/library-content/products/fund-data/etfs/us/holdings-daily-us-en-spy.xlsx
# NEW (> 2024-08-16): https://www.ssga.com/us/en/institutional/library-content/products/fund-data/etfs/us/holdings-daily-us-en-spy.xlsx
# spdr_link <- paste0("https://us.spdrs.com/site-content/xls/", x, "_All_Holdings.xls")
spdr_link <- paste0("https://www.ssga.com/us/en/institutional/etfs/library-content/products/fund-data/etfs/us/holdings-daily-us-en-", tolower(x), ".xlsx")
spdr_link <- paste0("https://www.ssga.com/us/en/institutional/library-content/products/fund-data/etfs/us/holdings-daily-us-en-", tolower(x), ".xlsx")

# Results container
res <- list(df = NULL, err = NULL)
Expand Down

0 comments on commit 58e8db3

Please sign in to comment.