get_price {td} | R Documentation |
Quote Data Accessor for ‘twelvedata’
Description
Retrieve Securities Real-Time Price Data from ‘twelvedata’
Usage
get_price(
sym,
as = c("data.frame", "raw"),
exchange = "",
country = "",
type = c(NA_character_, "Stock", "Index", "ETF", "REIT"),
dp = 5,
apikey
)
Arguments
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. In the case of a vector of arguments a vector or prices is returned. |
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. |
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. |
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 |
Details
This is lightweight accessor which also returns the price. See get_quote()
for a richer
return set.
The function has been named get_price()
to be consistent with the get_quote()
function.
Value
The requested data is returned.
Author(s)
Dirk Eddelbuettel