Class for retrieving data related to market indices from the Yahoo Finance API.
Inherits get_history() from YahooFinanceBase-class.
See also
Other historical data:
Ticker-class,
Tickers,
yf_download_prices(),
yf_get_index_quotes()
Super class
YahooFinanceBase -> Index
Methods
Inherited methods
Index$new()
Create a new Index object.
Usage
Index$new(symbol = NA, index = NA, validate = TRUE)Arguments
symbolSymbol (e.g.,
"^NSEI").indexDeprecated. Use
symbolinstead.validateLogical; if TRUE, validate symbol against Yahoo Finance. Defaults to TRUE.
Examples
nifty_50 <- Index$new('^NSEI')Index$set_index()
Set a new index symbol.
Arguments
symbolNew symbol.
indexDeprecated. Use
symbolinstead.validateLogical; if TRUE, validate symbol against Yahoo Finance. Defaults to TRUE.
Examples
indice <- Index$new('^NSEI')
indice$set_index('^NDX')Examples
## ------------------------------------------------
## Method `Index$new()`
## ------------------------------------------------
if (FALSE) { # \dontrun{
nifty_50 <- Index$new('^NSEI')
} # }
## ------------------------------------------------
## Method `Index$set_index()`
## ------------------------------------------------
if (FALSE) { # \dontrun{
indice <- Index$new('^NSEI')
indice$set_index('^NDX')
} # }