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

Remove cumulative returns functionalities #2103

Merged
merged 3 commits into from
Jul 18, 2022
Merged

Conversation

montezdesousa
Copy link
Contributor

@montezdesousa montezdesousa commented Jul 18, 2022

Description

This PR removes the cret functionalities. Cumulative returns as implemented are assuming bullet investment at portfolio inception, what's not consistent with the period investment allowed by loading transactions. The total amount invested under periodic investments is constantly changing and cumulative product of 1+return will not capture that.

Example:

Date Investment Cumulative investment Daily return Cash return Cumulative cash return
0 1000$ 1000$ 5% 50$ 50$
1 1000$ 2000$ 2% 40$ 90$

Current calculation:
cret = (1+5%)*(1+2%) - 1= 7.1%
cash ret from cret = 7.1% * 2000$ = 142$

Real cumulative return:
Cumulative cash return / cumulative investment = 90/2000 = 4.5%

  • Summary of the change / bug fix.
  • Relevant motivation and context.

Checklist:

Others

  • I have performed a self-review of my own code.
  • My code passes all the checks pylint, flake8, black, ... To speed up development you should run pre-commit install.
  • New and existing unit tests pass locally with my changes. You can test this locally using pytest tests/....

@montezdesousa montezdesousa added the bug Fix bug label Jul 18, 2022
@montezdesousa montezdesousa requested a review from JerBouma July 18, 2022 10:08
@piiq piiq merged commit 82b6411 into main Jul 18, 2022
@piiq piiq deleted the remove_cumulative_returns branch July 18, 2022 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fix bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants