This is a set of Finance::Quote modules to fetch prices of Brazilian government and private bonds, Bovespa stocks, and mutual funds available at various banks.
Currently the following quoters are implemented:
- ADVFNBrasil: Bovespa stocks
- BMFBovespa: Private bonds
- SNDBrasil: Private bonds negotiated on the secondary market
- TNBrasil: Tesouro Direto (government bonds)
- HSBCBrasil: Mutual funds from HSBC Brasil bank
- VAM: Mutual funds from Votorantim Asset Management
There's no package installer. Just copy the pm modules to
/usr/local/lib/site_perl/Finance/Quote
and set the FQ_LOAD_QUOTELET
environment variable so that Gnucash loads those modules. For example:
export FQ_LOAD_QUOTELET="Currencies Yahoo::Brasil TNBrasil SNDBrasil BMFBovespa"
Bond and mutual fund symbols are sometimes not available. In those cases a "fake symbol" – usually formed by replacing spaces with underscores – should be supplied to the quoter. For example:
-
BMFBovespa: use real symbol
- TRIA-DEB22 ⇒
TRIA-DEB22
- TRIA-DEB22 ⇒
-
SNDBrasil: use real symbol
- ITAP13 ⇒
ITAP13
- ITAP13 ⇒
-
TNBrasil: use official name (†) followed by maturity date in ddmmyy format
- Tesouro IPCA+ 2019 ⇒
NTN-B_Principal_150519
- Tesouro Selic 2021 ⇒
LFT_010321
- Tesouro IPCA+ 2019 ⇒
-
HSBCBrasil:
- HSBC FIC FI RF CURTO PRAZO ⇒
HSBC_FIC_FI_RF_CURTO_PRAZO
- HSBC FIC FI RF CURTO PRAZO ⇒
-
VAM:
- FIA Dividendos ⇒
FIA_Dividendos
- FIA Dividendos ⇒
(†) Nicknames and official names for Brazilian government bonds are as follows:
- Tesouro Prefixado ⇒ LTN
- Tesouro Selic ⇒ LFT
- Tesouro Prefixado com Juros Semestrais ⇒ NTN-F
- Tesouro IPCA+ ⇒ NTN-B Principal
- Tesouro IPCA+ com Juros Semestrais ⇒ NTN-B
If you have any issues trying to obtain quotes (from an interactive application
like GnuCash) the script bin/getquote.pl
may help with debugging. For example:
$ getquote.pl tesourodireto LFT_010321
LFT_010321: 7707.61 @ 2016-04-29 (last)
$ getquote.pl bmfdebentures TRIA-DEB22
TRIA-DEB22: 15131.170000 @ 2016-04-29 (last)
$ getquotes.pl vamfundos FIA_Dividendos
FIA_Dividendos: 0.701088117 @ 2016-04-28 (last)
- Add quoters for mutual funds of various banks.
Released under MIT License. See LICENSE
for details.