Description Usage Arguments Value Examples
Get OHLC aggregates for a date range, in custom time window sizes for a ticker.
1 2 3 4 5 6 7 | get_aggregates(
ticker,
multiplier,
timespan = c("minute", "hour", "day", "week", "month", "quarter", "year"),
from,
to
)
|
ticker |
(string) Ticker symbol of the request. Some tickers require a prefix, see examples below: Stocks: 'AAPL' Currencies: 'C:EURUSD' Crypto: 'X:BTCUSD' |
multiplier |
(integer) Size of the timespan multiplier. |
timespan |
(string) Size of the time window. Options include: 'minute', 'hour', 'day', 'week', 'month', 'quarter', 'year'. |
from |
(Date) From date ('YYYY-MM-DD'). |
to |
(Date) To date ('YYYY-MM-DD'). |
A tibble of financial data.
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
library(polygon)
get_aggregates(
ticker = "AAPL",
multiplier = 1,
timespan = "day",
from = Sys.Date() - 20,
to = Sys.Date() - 1
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.