Description Usage Arguments Details Value Author(s) See Also
Retrieve Securities Quotes Data from ‘twelvedata’
1 2 3 4 5 6 7 8 9 10 11 12 13 | get_quote(
sym,
interval = c("1min", "5min", "15min", "30min", "45min", "1h", "2h", "4h", "1day",
"1week", "1month"),
as = c("data.frame", "raw"),
exchange = "",
country = "",
volume_time_period = 9,
type = c(NA_character_, "Stock", "Index", "ETF", "REIT"),
dp = 5,
timezone = NA_character_,
apikey
)
|
sym |
(character) A (single or vector) symbol understood by the backend as a stock symbol, foreign exchange pair, or more. See the ‘twelvedata’ documentation for details on what is covered. |
interval |
(character) A valid interval designator ranging form “1min” to “1month”. Currently supported are 1, 5, 15, 30 and 45 minutes, 1, 2, 4 hours (using suffix ‘h’, as well as “1day”, “1week” and “1month”. |
as |
(optional, character) A selector for the desired output format: one of “data.frame” (the default) or or “raw”. |
exchange |
(optional, character) A selection of the exchange for which data for “sym” is requested, default value is unset. |
country |
(optional, character) A selection of the country exchange for which data for “sym” is requested, default value is unset. |
volume_time_period |
(optional, numeric) The number of days to use when computing average volume, default is 9. |
type |
(optional, character) A valid security type selection, if set it must be one of
“Stock” (the default), “Index”, “ETF” or “REIT”. Default is
unset via the |
dp |
(optional, numeric) The number of decimal places returned on floating point numbers. The value can be between 0 and 11, with a default value of 5. |
timezone |
(optional, character) The timezone of the returned time stamp. This parameter
is optional. Possible values are “Exchange” (the default) to return the
exchange-supplied value, “UTC” to use UTC, or a value IANA timezone name such as
“America/New_York” (see |
apikey |
(optional character) An API key override, if missing a value cached from
package startup is used. The startup looks for either a file in the per-package config
directory provided by |
The function has been named get_quote()
to not clash with the base R function
quote
.
The requested data is returned as a data.frame
object with as many rows
as there were symbols in the request.
Dirk Eddelbuettel
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.