ref_stocks: Reference Data Accessor for Stocks from 'twelvedata'

Description Usage Arguments Details Value See Also

View source: R/ref_stocks.R

Description

Retrieve Reference Data for Stocks from ‘twelvedata’

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
ref_stocks(
  sym = "",
  as = c("data.frame", "raw"),
  exchange = "",
  country = "",
  type = c(NA_character_, "EQUITY", "Common", "Common Stock",
    "American Depositary Receipt", "Real Estate Investment Trust (REIT)", "Unit", "GDR",
    "Closed-end Fund", "ETF", "Depositary Receipt", "Preferred Stock",
    "Limited Partnership", "OTHER_SECURITY_TYPE", "Warrant", "STRUCTURED_PRODUCT",
    "Exchange-traded Note", "Right", "FUND", "Trust", "Index",
    "Unit Of Beneficial Interest", "MUTUALFUND", "New York Registered Shares"),
  apikey
)

Arguments

sym

(optional, 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.

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. Default value is unset.

country

(optional, character) A selection of the country exchanges. Default value is unset.

type

(optional, character) A valid security type selection, if set it must be one of formals(ref_stock)$type, with NA as default.

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 tools::R_user_dir (for R 4.0.0 or later), or the TWELVEDATA_API_KEY variable.

Details

ref_stocks.

Value

The requested data is returned as a data.frame object.

See Also

https://twelvedata.com/docs


td documentation built on Jan. 27, 2022, 1:16 a.m.