Set Up Accrual Methods #56
Conversation
gustavobsoares
left a comment
There was a problem hiding this comment.
Check on __accrual_bus(self, rates, dates) ... I think it's making the wrong calculation.
| return self.__accrual(accrual) | ||
|
|
||
| def __accrual_bus(self, rates, dates): | ||
| return self.__accrual((rates/100)/252) |
There was a problem hiding this comment.
I do not think this is correct. It seems like you are dividing the rates by 252 but the BUS accrual by anbima is exponencial, a day's return is given by (1 + rate) ** (1/252) -1 not rate/252 like you have in ACT. See file attached:
Interest-Rate-Instruments-and-Market-Conventions.pdf
| raise | ||
|
|
||
|
|
||
| if __name__ == "__main__": |
There was a problem hiding this comment.
Normally, we leave the classes in a separate file and create an example file (see for example the bloomberg api folder). Also, if you are interested, you can use the FiananceHub API to grab the CDI series directly from the BACEN website. This would be way cooler as an a example file.
No description provided.