indexreport_get: Fetches indexes data from B3

View source: R/scraper-indexes.R

indexreport_getR Documentation

Fetches indexes data from B3

Description

Downloads index data from B3 website https://www.b3.com.br/pt_br/market-data-e-indices/servicos-de-dados/market-data/historico/boletins-diarios/pesquisa-por-pregao/pesquisa-por-pregao/.

Usage

indexreport_mget(
  first_date = Sys.Date() - 5,
  last_date = Sys.Date(),
  by = 1,
  cache_folder = cachedir(),
  do_cache = TRUE
)

indexreport_get(
  refdate = Sys.Date(),
  cache_folder = cachedir(),
  do_cache = TRUE
)

Arguments

first_date

First date ("YYYY-MM-DD") to yc_mget multiple curves

last_date

Last date ("YYYY-MM-DD") to yc_mget multiple curves

by

Number of days in between fetched dates (default = 1) in yc_mget

cache_folder

Location of cache folder (default = cachedir())

do_cache

Whether to use cache or not (default = TRUE)

refdate

Specific date ("YYYY-MM-DD") to yc_get single curve

Details

indexreport_get returns index data for the given date and indexreport_mget returns index data for a given range of dates.

Value

A dataframe with index data (OHLC, average and daily oscillation)

Examples

## Not run: 
df_ir <- indexreport_mget(Sys.Date() - 5, Sys.Date())
head(df_ir)

## End(Not run)
## Not run: 
df_ir <- indexreport_get(Sys.Date())
head(df_ir)

## End(Not run)

rb3 documentation built on April 14, 2023, 5:10 p.m.