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

Compute Sortino ratio (#67) #108

Merged
merged 33 commits into from
Aug 2, 2023
Merged

Conversation

fmilthaler
Copy link
Owner

Addition of Sortino ratio to FinQuant

@fmilthaler fmilthaler marked this pull request as draft July 18, 2023 16:42
@fmilthaler fmilthaler self-assigned this Jul 24, 2023
@PietropaoloFrisoni
Copy link
Collaborator

Amazing, I didn't realize that so much work was already done to add the Sortino Ratio to FinQuant. Thank you so much for your work @aft90 and @fmilthaler! I will happily go into the details and complete the feature implementation as soon as possible.

Sorry to bother you @fmilthaler, but it looks like some checks (build 3.11) were not successful. I tried to resolve some conflicts which appeared after pulling and pushing an empty commit as a test, and I hope I haven't done any damage : ). Do you have any idea how to solve these?

All the best

@PietropaoloFrisoni
Copy link
Collaborator

PietropaoloFrisoni commented Jul 26, 2023

@fmilthaler Ok, it is all fixed now.

@fmilthaler
Copy link
Owner Author

Amazing, I didn't realize that so much work was already done to add the Sortino Ratio to FinQuant. Thank you so much for your work @aft90 and @fmilthaler! I will happily go into the details and complete the feature implementation as soon as possible.

Sorry to bother you @fmilthaler, but it looks like some checks (build 3.11) were not successful. I tried to resolve some conflicts which appeared after pulling and pushing an empty commit as a test, and I hope I haven't done any damage : ). Do you have any idea how to solve these?

All the best

Sorry, I couldn't check it out yesterday, but seems like you got it solved now. Well done :)

@fmilthaler
Copy link
Owner Author

@PietropaoloFrisoni Apologies for not telling you about this.
I saw that you updated README.tex.md manually, and then your changes were overwritten by the automated script. You should not update the README.tex.md. The actual readme of the project is README.md. When you make changes in there, they are automatically ported over to README.tex.md (just to keep that file up to date). By now it is somewhat of an redundant version, which was initially used to get the LaTeX equations into README.md.

Anyways, make your changes in README.md, not README.tex.md :)

@PietropaoloFrisoni
Copy link
Collaborator

Thank you, Frank. I was actually going to ask you what was going on XD.

Before next week I'll most probably complete this PR (I would like to perform some sanity checks on the Sortino Ratio with other sources first).

All the best

@PietropaoloFrisoni PietropaoloFrisoni marked this pull request as ready for review August 1, 2023 08:25
@PietropaoloFrisoni
Copy link
Collaborator

PietropaoloFrisoni commented Aug 1, 2023

Ultimately, I implemented the Sortino ratio described in this document.

Different documents and tutorials seem to implement slightly different versions of the Sortino ratio. Performing the same test with the portfolio described in this example using FinQuant delivers the same result of PerformanceAnalytics R package, which provides a function to compute the Sortino ratio. (There is a slight difference since the example considers Close Price instead of the Adjusted Close Price, but using the same format gives precisely the same output).

@fmilthaler Please let me know if you like the current order in which the portfolio parameters are displayed or if there is anything you want to add/remove/change : )

All the best

@fmilthaler
Copy link
Owner Author

Excellent, I'll take a more detailled look at it tomorrow.
Could you please add this to one of the examples? I guess Example-Analysis would be the best place?!

@PietropaoloFrisoni
Copy link
Collaborator

Excellent, I'll take a more detailled look at it tomorrow. Could you please add this to one of the examples? I guess Example-Analysis would be the best place?

Yep, I keep forgetting about updating the examples. I'll add it tomorrow 👍

finquant/portfolio.py Outdated Show resolved Hide resolved
@fmilthaler
Copy link
Owner Author

Other than the docstring comment (which you actually did correctly, strictly speaking), this looks good to me. Will approve and merge as soon as the comment is re-added.

@fmilthaler
Copy link
Owner Author

One additional request: Could you add this line to CONTRIBUTORS.md:

- @aft90: helped to implement the Sortino Ratio

Copy link
Owner Author

@fmilthaler fmilthaler left a comment

Choose a reason for hiding this comment

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

As mentioned in the comments with more details:

  1. please revert the change of removing part of the docstring, and
  2. update the list of contributors

Copy link
Owner Author

@fmilthaler fmilthaler left a comment

Choose a reason for hiding this comment

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

Since I was part of this PR, I cannot formally approve, but unofficial I do. Ready to be merged.

@PietropaoloFrisoni PietropaoloFrisoni merged commit a2d01de into master Aug 2, 2023
@PietropaoloFrisoni PietropaoloFrisoni deleted the feature/sortino-ratio branch August 2, 2023 14:18
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.

3 participants