Skip to content

Conversation

@andretrofino
Copy link

No description provided.

Copy link
Member

@gustavobsoares gustavobsoares left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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__":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants