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
calculation issues with rolling_sharpe() and rolling_sortino() #78
Comments
Item no. 1 was fixed in 0.0.34. As for item 2 - if you can provide a PR that would be great :) |
I did a benchmark with a pandas rolling apply() implementation compared to using empyrical's |
Here is the pull request: #100 |
Hi Kartik, Mind posting Pandas Thanks! |
Here you go: kartiksubbarao@853da02 |
@ranaroussi 7156af7 fixes some of these issues, but there is still a calculation issue with rolling_sortino(). I'll close this and report a new issue for that one. |
I noticed a couple of calculation issues with the
rolling_sharpe()
androlling_sortino()
functions used in the tearsheet graphs:rolling_sharpe()
androlling_sortino()
: Theperiod
variable is used to specify the number of days in the rolling window (by default 126). However,period
is also used to annualize the daily returns data forreturns
andbenchmarks
, which is incorrect. Irrespective of the number of days in the rolling window, the returns are still daily returns, so the factor should be 252. [For Creating reports on monthly returns data #74, a new variable would need to be created --period
can't do double duty as both the number of datapoints in the rolling window, AND the timespan that each datapoint represents :-) ]rolling_sortino()
inwrappers.py
, the target downside deviation is not calculated as per the Red Rock Capital whitepaper cited in thesortino()
function instats.py
.rolling_sortino()
throws away all the positive returns and only takes the standard deviation of the negative returns, which is the opposite of the whitepaper's recommendation. I'm currently using this inrolling_sortino()
as a workaround:I'd be happy to provide a pull request for these items, just let me know.
The text was updated successfully, but these errors were encountered: