Title: | Get Data for Brazilian Bonds (Tesouro Direto) |
---|---|
Description: | Downloads and aggregates data for Brazilian government issued bonds directly from the website of Tesouro Direto <https://www.tesourodireto.com.br/>. |
Authors: | Marcelo Perlin [aut, cre] |
Maintainer: | Marcelo Perlin <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.5.6 |
Built: | 2025-03-04 05:04:05 UTC |
Source: | https://github.com/msperlin/gettddata |
Returns cache directory
get_cache_folder()
get_cache_folder()
a path
get_cache_folder()
get_cache_folder()
Returns available nammes at TD site
get_td_names()
get_td_names()
string vector
get_td_names()
get_td_names()
Downloads and parses information about the current Brazilian yield curve.
get.yield.curve()
get.yield.curve()
A dataframe with information about the yield curve
## Not run: df.yield <- get.yield.curve() str(df.yield) ## End(Not run)
## Not run: df.yield <- get.yield.curve() str(df.yield) ## End(Not run)
This function looks into the tesouro direto website (https://www.tesourodireto.com.br/) and downloads all of the files containing prices and yields of government bonds. You can use input asset_codes to restrict the downloads to specific bonds
td_get( asset_codes = "LTN", first_year = 2005, last_year = as.numeric(format(Sys.Date(), "%Y")), dl_folder = get_cache_folder() )
td_get( asset_codes = "LTN", first_year = 2005, last_year = as.numeric(format(Sys.Date(), "%Y")), dl_folder = get_cache_folder() )
asset_codes |
Strings that identify the assets (1 or more assets) in the names of the excel files. E.g. asset_codes = 'LTN'. When set to NULL, it will download all available assets |
first_year |
first year of data (minimum of 2015) |
last_year |
first year of data |
dl_folder |
Name of folder to save excel files from tesouro direto (will create if it does not exists) |
TRUE if successful
## Not run: td_get("LTN", 2020, 2022) ## End(Not run)
## Not run: td_get("LTN", 2020, 2022) ## End(Not run)
Fetches current prices of TD assets from website's json api at <https://www.tesourodireto.com.br/titulos/precos-e-taxas.htm>
td_get_current()
td_get_current()
a dataframe with prices
## Not run: td_get_current() ## End(Not run)
## Not run: td_get_current() ## End(Not run)