Skip to contents

Class for retrieving data related to market indices from the Yahoo Finance API. Inherits get_history() from YahooFinanceBase-class.

Format

An R6 class object

See also

Super class

yahoofinancer::YahooFinanceBase -> Index

Active bindings

index

Deprecated. Returns self$symbol.

Methods

Inherited methods


Method new()

Create a new Index object.

Usage

Index$new(symbol = NA, index = NA)

Arguments

symbol

Symbol (e.g., "^NSEI").

index

Deprecated. Use symbol instead.

Returns

A new Index object.

Examples

\dontrun{
nifty_50 <- Index$new('^NSEI')
}


Method set_index()

Set a new index symbol.

Usage

Index$set_index(symbol = NA, index = NA)

Arguments

symbol

New symbol.

index

Deprecated. Use symbol instead.

Examples

\dontrun{
indice <- Index$new('^NSEI')
indice$set_index('^NDX')
}


Method clone()

The objects of this class are cloneable with this method.

Usage

Index$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

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')
} # }