Description Usage Arguments Details Examples
The Tiingo API provides a large feed of historical data at the daily (and weekly, monthly, or annual) level.
1 2 3 4 5 6 | riingo_prices(
ticker,
start_date = NULL,
end_date = NULL,
resample_frequency = "daily"
)
|
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 |
end_date |
The last date to download data for.
A character in the form YYYY-MM-DD, or a |
resample_frequency |
For Tiingo data, a character specified as one of:
For IEX data, a character specified at the For Crypto data, a character specified at the |
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:
daily: Values returned as daily periods, with a holiday calendar
weekly: Values returned as weekly data, with days ending on Friday
monthly: Values returned as monthly data, with days ending on the last standard business day (Mon-Fri) of each month
annually: Values returned as annual data, with days ending on the last standard business day (Mon-Fri) of each year
Note, that if you choose a value in-between the resample period for weekly, monthly, and daily, the start date rolls back to consider the entire period. For example, if you choose to resample weekly, but your "start_date" parameter is set to Wednesday of that week, the start_date will be adjusted to Monday, so the entire week is captured. Another example is if you send a start_date mid-month, we roll back the start_date to the beginning of the month.
Similarly, if you provide an end_date, and it's midway through the period, we roll-forward the date to capture the whole period. In the above example, if the end date is set to a wednesday with a weekly resample, the end date is rolled forward to the Friday of that week.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.