Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error - win_year / periods_per_year not passed to CAGR function #307

Open
diegoturing opened this issue Sep 22, 2023 · 2 comments
Open

Error - win_year / periods_per_year not passed to CAGR function #307

diegoturing opened this issue Sep 22, 2023 · 2 comments

Comments

@diegoturing
Copy link

diegoturing commented Sep 22, 2023

In line 839 of the file 'reports.py' the function '_stats.cagr' is called without passing the periods per year defined in the main call:

metrics["CAGR﹪%"] = _stats.cagr(df, rf, compounded) * pct

This causes the CAGR to always be calculated with the default periods per year (252), which leads to errors in the calculation when using other periods. It should be solved with:

metrics["CAGR﹪%"] = _stats.cagr(df, rf, compounded, periods=win_year) * pct

@yarimiz
Copy link
Contributor

yarimiz commented Sep 23, 2023

Duplicate of #291

Unfortunately, @ranaroussi is merging PR relatively slowly so this still is an active bug although a PR is available

@BlackArbsCEO
Copy link

I was coming to report the same error. I'm not sure it's a duplicate because the periods parameter is not being passed at all whereas the other issue recommends using 365 as the default number of periods if I understand correctly.

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

No branches or pull requests

3 participants