riingo_prices: Get stock or ETF prices from the Tiingo API

Description Usage Arguments Details Examples

Description

The Tiingo API provides a large feed of historical data at the daily (and monthly, quarterly, or yearly) level.

Usage

1
2
riingo_prices(ticker, start_date = NULL, end_date = NULL,
  resample_frequency = "daily")

Arguments

ticker

One or more tickers to download data for from Tiingo. Can be a stock, mutual fund, or ETF. A character vector.

start_date

The first date to download data for. A character in the form YYYY-MM-DD, or a Date variable. The default is to download 1 year's worth of data.

end_date

The last date to download data for. A character in the form YYYY-MM-DD, or a Date variable.

resample_frequency

For Tiingo data, a character specified as one of: "daily", "monthly", "quarterly" or "yearly". For IEX data, a character specified at the "min" or "hour" frequencies in the form: "1min", "5min", or "2hour". For Crypto data, a character specified at the "min", "hour" or "day" frequencies similar to IEX.

Details

Multiple downloads are done sequentially, meaning that downloading 5 tickers costs 5 requests against your usage limits. Sadly Tiingo does not support batch downloads at the moment.

Tiingo supplied documentation regarding the resample frequency:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 

# Downloading 1 year's worth of prices for AAPL
riingo_prices("AAPL")

# Downloading a range of data, using 2 tickers
riingo_prices(c("AAPL", "MSFT"), "1999-01-01", "2005-01-01")

# Monthly data
riingo_prices(c("AAPL", "MSFT"), "1999-01-01", "2005-01-01", "monthly")


## End(Not run)

business-science/riingo documentation built on May 29, 2019, 10:35 a.m.