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

unable to create tearsheet when only there is a 1 action (quantstat.reports.metrics) #385

Open
Ramandeep2121 opened this issue Nov 27, 2024 · 0 comments

Comments

@Ramandeep2121
Copy link

Hello ,
I have dataframe and suppose i am having action column with 0 values except one having 1 value (signal for long) , now i use this to calcuate portfolio returns (pv_returns) and ,
there is code in "quantstat.reports.metrics" :

if compounded: metrics["Cumulative Return %"] = (_stats.comp(df) * pct).map("{:,.2f}".format) else: metrics["Total Return %"] = (df.sum() * pct).map("{:,.2f}".format)

when i calculate pv_returns based on the actions i have , it has only 1 value 0.0015 and others are 0.0000 , then quanstat considers 0.0015 as 0.00 , which leads to a problem as tearsheet showing no returns but value i have passed has value (0.0015), so can you suggest me any solution to overcome this.

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

No branches or pull requests

1 participant