BatchGetSymbols error in download

Hello there! I am trying to use BatchGetSymbols to download financial data for a particular list of tickers, unfortunately, I get the message " Error in download.." for the vast majority of tickers. I've found an old post with a similar issue but the solution there was just to wait and this doesn't seem to work in this case.

This is the code I am using. I have included just the first 4 tickers as the problem persists regardless of the number of tickers I include. With these four I get the error for the first three while I am able to download the last one

..
#R
library(BatchGetSymbols)

tick<-c("AAP","ABT","AFL","AIG")

b.out<-BatchGetSymbols(tickers = tick,
first.date =as.Date(2015-30-09),
last.date = as.Date(2020-30-09))
...

I am quite new to R and any kind of help would be greatly appreciated.

Thanks

Giacomo

Hi,

You have to put quotes in dates and specify the appropriate format to convert from character to Date, as.Date("2015-30-09", format = "%Y-%d-%m"), alternatively you can put in descending format like as.Date("2015-09-30").

library(BatchGetSymbols)

tick<-c("AAP","ABT","AFL","AIG")

b.out<-BatchGetSymbols(tickers = tick,
                       first.date =as.Date("2015-30-09", format = "%Y-%d-%m"),
                       last.date = as.Date("2020-30-09", format = "%Y-%d-%m"))
#> 
#> Running BatchGetSymbols for:
#> 
#>    tickers =AAP, ABT, AFL, AIG
#>    Downloading data for benchmark ticker
#> ^GSPC | yahoo (1|1) | Not Cached | Saving cache
#> AAP | yahoo (1|4) | Not Cached | Saving cache - Got 100% of valid prices | Good stuff!
#> ABT | yahoo (2|4) | Not Cached | Saving cache - Got 100% of valid prices | Good stuff!
#> AFL | yahoo (3|4) | Not Cached | Saving cache - Got 100% of valid prices | You got it!
#> AIG | yahoo (4|4) | Not Cached | Saving cache - Got 100% of valid prices | Good stuff!

It would be good to run the code with reprex to make feedback easier.

Thank you very much! Sorry for not using the correct format as I said I am quite new at using R

Sure no problem. If the answer is satisfactory please make sure to mark it as solved to stop other people who want to help from visiting this post.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.