Learn R Programming

rtsdata (version 0.1.4)

ds.getSymbol.yahoo: Get quotes from Yahoo Finance

Description

Download historical data from Yahoo Finance using `getSymbols.yahoo` function from `quantmod` package.

Download historical data from FRED using `get_fred_series` function from `alfred` package.

Download historical data from Quandl using `Quandl` function from `Quandl` package.

Download historical data from AlphaVantage using `getSymbols.av` function from `quantmod` package.

Download historical data from Tiingo using `getSymbols.tiingo` function from `quantmod` package.

Generate fake stock data for use in rtsdata examples

Usage

ds.getSymbol.yahoo(Symbol, from = "1900-01-01", to = Sys.Date())

ds.getSymbol.FRED(Symbol, from = "1900-01-01", to = Sys.Date())

ds.getSymbol.Quandl(Symbol, from = "1900-01-01", to = Sys.Date())

ds.getSymbol.av(Symbol, from = "1900-01-01", to = Sys.Date())

ds.getSymbol.tiingo(Symbol, from = "1900-01-01", to = Sys.Date())

ds.getSymbol.fake.stock.data(Symbol, from = "1900-01-01", to = Sys.Date())

Value

xts object with data

Arguments

Symbol

symbol

from

start date, expected in yyyy-mm-dd format, defaults to 1900-01-01

to

end date, expected in yyyy-mm-dd format, defaults to today's date

Details

Quandl recommends getting an API key Add following code options(Quandl.api_key = api_key) to your .Rprofile file

You need an API key from www.alphavantage.co Add following code options(getSymbols.av.Default = api_key) to your .Rprofile file

You need an API key from api.tiingo.com Add following code options(getSymbols.av.Default = api_key) to your .Rprofile file

Examples

Run this code
 # get sample of the fake stock data
 ds.getSymbol.fake.stock.data('dummy', from = '2018-02-01', to = '2018-02-13')

Run the code above in your browser using DataLab