Learn R Programming

BatchGetSymbols (version 2.6.4)

GetIbovStocks: Function to download the current components of the Ibovespa index from Bovespa website

Description

This function scrapes the stocks that constitute the Ibovespa index from the wikipedia page at http://bvmf.bmfbovespa.com.br/indices/ResumoCarteiraTeorica.aspx?Indice=IBOV&idioma=pt-br.

Usage

GetIbovStocks(
  do.cache = TRUE,
  cache.folder = file.path(tempdir(), "BGS_Cache"),
  max.tries = 10
)

Arguments

do.cache

Use cache system? (default = TRUE)

cache.folder

Where to save cache files? (default = file.path(tempdir(), 'BGS_Cache') )

max.tries

Maximum number of attempts to download the data

Value

A dataframe that includes a column with the list of tickers of companies that belong to the Ibovespa index

Examples

Run this code
# NOT RUN {
df.ibov <- GetIbovStocks()
print(df.ibov$tickers)
# }

Run the code above in your browser using DataLab