Comments (5)
No drawdowns??! 😀
Fixed in 0.0.16 ...
from quantstats.
Thank you for the quick fix.
It actually seems like there is one more obscure scenario. In stats.drawdown_details()
we could have an ever-increasing series which means it starts with a drawdown but there is no ends
so it fails with an IndexError.
# drawdown series begins in a drawdown
if starts[0] > ends[0]: # <-- ends could be empty
starts.insert(0, drawdown.index[0])
I wish I had such strategies but in reality I am using your library to calculate incremental results as live trading goes on so in the beginning such scenarios can occur.
from quantstats.
Let me know if 0.0.17 fixed the issue
from quantstats.
The error happened with new version. I tried to compare the portfolio with deposit without any drawdowns and i got next:
ValueError: cannot convert float NaN to integer
from quantstats.
Getting the same error:
Traceback (most recent call last):
File "test.py", line 269, in <module>
qs.reports.html(returns['net_worth'], benchmark, output=os.path.join(projectDir, 'report.html'))
File "/home/athena/anaconda3/envs/unicorn/lib/python3.8/site-packages/quantstats/reports.py", line 58, in html
mtrx = metrics(returns=returns, benchmark=benchmark,
File "/home/athena/anaconda3/envs/unicorn/lib/python3.8/site-packages/quantstats/reports.py", line 299, in metrics
dd = _calc_dd(df, display=(display or "internal" in kwargs))
File "/home/athena/anaconda3/envs/unicorn/lib/python3.8/site-packages/quantstats/reports.py", line 587, in _calc_dd
'Longest DD Days': str(round(bench_dd.sort_values(
ValueError: cannot convert float NaN to integer
Using quantstats 0.0.25, pandas 1.0.3
from quantstats.
Related Issues (20)
- Incompatibility with AWS Lambda HOT 1
- TypeError: unsupported operand type(s) for +: 'float' and 'str' HOT 3
- Warings about pd.to_timedelta
- 'TypeError: super(type, obj): obj must be an instance or subtype of type' in the super() function of reports.html HOT 1
- stats.py: res = abs(total + 1.0) ** (1.0 / years) - 1 <-- ZeroDivisionErrorZeroDivisionError HOT 1
- Deprecated code in stats.py expected_return() HOT 1
- Calculation of 3Y and 5Y annualized return date lag HOT 1
- report.py's cagr function doesn't include the days per year options HOT 1
- Fix kelly_criterion formula for investment scenario HOT 1
- draw visuals in plotly HOT 1
- Jupyter import issue: `magic(...)` is deprecated HOT 1
- Cumulative Performance in reports.html does not calculate correctly HOT 4
- Generate full html_report but save as image
- Datetime issue
- "Strategy" HOT 2
- is _qtd bug ? HOT 1
- utils.make_index : TypeError: unsupported operand type(s) for +: 'float' and 'str' HOT 8
- Quantstats.plot Cannot Generate Plot HOT 1
- Errors in calculating drawdowns? HOT 2
- CAGR calculations HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quantstats.