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

bugfix Cum. Active Returns with cumprod #297

Merged
merged 2 commits into from
May 26, 2021

Conversation

floatinghotpot
Copy link
Contributor

@floatinghotpot floatinghotpot commented May 23, 2021

In performance/percent_return.py:
pct_return = close.pct_change(length) # (close / close.shift(length)) - 1
So, when calculate back, it should be:
cum return = (1 + pct_return).cumprod() -1

As the close of today has been used for calculation, we cannot earn the return of today. Our trade decision only earn the return of next day.

BTW, nice example, appreciated for the good job!

@twopirllc
Copy link
Owner

Hi @floatinghotpot,

I'll merge it in as soon as I can.

Thanks,
KJ

twopirllc added a commit that referenced this pull request May 26, 2021
@twopirllc twopirllc merged commit d176b1f into twopirllc:development May 26, 2021
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.

2 participants