-
Notifications
You must be signed in to change notification settings - Fork 47
Sharpe/Sortino period needs to be 252 for financial markets #30
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
Comments
This makes a lot of sense. If you submit a pull request then I can add it
to the project
Robert Grzesik 347-635-3416
…On Tue, Apr 23, 2024 at 1:39 PM Koha101 ***@***.***> wrote:
The period has been changed from 252 in quantstats to 365 in
quanstats_lumi, to correct the CAGR calculation, since it uses calendar
days in its calculation. This breaks the sharpe and sortino calculations,
since they use the sqrt(period), which should be the number of trading
days, not calendar days, 252 for financial markets. The 365 number works
for crypto, since that's available 365 days/year.
I propose the default should be 252 for sharpe and sortino, and 365 for
CAGR. Additionally, it would be worth having 2 separate periods in
reports.py, calendar_period and trading_period, to use the correct one on
calls to the metrics, and expose the two periods in calls like
reports.html().
—
Reply to this email directly, view it on GitHub
<#30>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIYQK3NX7OZZRC3R5GXWGLY62METAVCNFSM6AAAAABGVMIQE2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGI2TSNBRGYYDIMY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I disagree with using 365 and 252 like this. Very simple fix for CAGR would be to just count the len(returns) to gather the number of days as opposed to the calendar calculation. Makes more sense IMO to standardize 252 as we are dealing with financial data. |
252 is correct imo, and 365 is wrong. unless you are working with an asset traded 24/7 like bitcoin. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The period has been changed from 252 in quantstats to 365 in quanstats_lumi, to correct the CAGR calculation, since it uses calendar days in its calculation. This breaks the sharpe and sortino calculations, since they use the sqrt(period), which should be the number of trading days, not calendar days, 252 for financial markets. The 365 number works for crypto, since that's available 365 days/year.
I propose the default should be 252 for sharpe and sortino, and 365 for CAGR. Additionally, it would be worth having 2 separate periods in reports.py, calendar_period and trading_period, to use the correct one on calls to the metrics, and expose the two periods in calls like reports.html().
The text was updated successfully, but these errors were encountered: