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

CAGR calculations #355

Open
localperf opened this issue Jun 2, 2024 · 2 comments
Open

CAGR calculations #355

localperf opened this issue Jun 2, 2024 · 2 comments

Comments

@localperf
Copy link

localperf commented Jun 2, 2024

I'm looking at the last 5 years of FAGIX (5/31/2019 - 5/31-2024).

Morningstar today says the 5-year trailing return is 7.14%

Quantstats tearsheet says the cumulative return is -6.76% and the CAGR is - 0.8%.

Close prices on first and last days of the 5 year period are $9.79 and $9.90 -- a small positive return.
Adjusted closing prices on those two days are $7.12 and $9.90, a cumulative return of 39%; and a CAGR of 6.8%

The 6.8% calculated here seems "close" to the 7.14% reported by Morningstar -- I don't know why they differ.

Bottom line: I think quantstats utils.download_returns should calculate returns using the Adj Close prices, not the Close prices.

I may easily be missing something -- but I'd like to be able to check quantstats with other sources.

Thanks for a GREAT package!

@jakewillms17
Copy link

Hey the reason they differ is because the utils_cagr function is incorrectly counting calendar days instead of trading days when identifying the annualization period.

years = (returns.index[-1] - returns.index[0]).days / periods

this method will unfortunately count calendar days, when in reality it would be more accurate to count the length of the returns object.

hopefully they fix this, I had to do this locally as I was getting incorrect CAGR's.

@grzesir
Copy link

grzesir commented Jul 30, 2024

Check out https://github.com/Lumiwealth/quantstats_lumi, which is being updated regularly. We are a fork of this library that is being maintained by Lumiwealth

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