0
votes

I'm trying to use getSymbols with my own set of tickers.

I have the tickers imported from a csv file with 55 tickers. But, how can I read the Tickers dataframe correctly when running the getSymbols?

Currently I'm having a NULL error when I run the code below.

library(quantmod)
Tickers <- read.csv("nasdaq_tickers_list.csv", stringsAsFactors = FALSE)
getSymbols(Tickers,from="2018-01-01", src="yahoo" )

If I run class(Tickers) it is a data.frame.

What I'm doing wrong? Thank you very much.

1

1 Answers

1
votes

If you read the helpfile for getSymbols by doing ?getSymbols, you'll see that the first argument needs to be "a character vector specifying the names of each symbol to be loaded". To get a character vector rather than a dataframe, do this:

getSymbols(Tickers$VARNAME, ...)

where VARNAME is the column name of the ticker column in your dataframe.