Downloading Yahoo stock prices in R

后端 未结 8 656
野趣味
野趣味 2020-12-12 13:46

This is a newbie question in R. I am downloading yahoo finance monthly stock price data using R where the ticker names are read from a text file. I am using a loop to read

8条回答
  •  情歌与酒
    2020-12-12 14:27

    I'm a little late to the party, but I think this will be very helpful to other late comers.

    The stockSymbols function in TTR fetches instrument symbols from nasdaq.com, and adjusts the symbols to be compatible with Yahoo! Finance. It currently returns ~6,500 symbols for AMEX, NYSE, and NASDAQ. You could also take a look at the code in stockSymbols that adjusts tickers to be compatible with Yahoo! Finance to possibly adjust some of the tickers in your file.

    NOTE: stockSymbols in the version of TTR on CRAN is broken due to a change on nasdaq.com, but it is fixed in the R-forge version of TTR.

提交回复
热议问题