riingo_iex_prices: Get stock or ETF prices from IEX through Tiingo

Description Usage Arguments Details Examples

Description

The Tiingo API provides a way to access data from IEX, The Investors Exchange. This data is supplied at a much lower (intraday!) frequency than the data from Tiingo's native API.

Usage

1
2
riingo_iex_prices(ticker, start_date = NULL, end_date = NULL,
  resample_frequency = "5min")

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

This feed returns the most recent 2000 ticks of data at the specified frequency. For example, "5min" would return the 2000 most recent data points spaced 5 minutes apart. You can subset the returned range with start_date and end_date, but you cannot request data older than today's date minus 2000 data points.

Because the default attempts to pull 1 year's worth of data, at a 5 minute frequency, all available data will be pulled so there is no need to use start_date and end_date. Only use them if you set the frequency to hourly.

Examples

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

# Pulling all available minute level data for Apple
riingo_iex_prices("AAPL", resample_frequency = "1min")

# This would result in an error, as you are pulling outside the available range
# riingo_iex_prices("AAPL", "1990-01-01", "2000-01-01", resample_frequency = "5min")


## End(Not run)

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