Giter VIP home page Giter VIP logo

Comments (5)

ranaroussi avatar ranaroussi commented on August 26, 2024 1

No drawdowns??! 😀

Fixed in 0.0.16 ...

from quantstats.

RatkoJ avatar RatkoJ commented on August 26, 2024

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.

ranaroussi avatar ranaroussi commented on August 26, 2024

Let me know if 0.0.17 fixed the issue

from quantstats.

Whisperes avatar Whisperes commented on August 26, 2024

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.

athenawisdoms avatar athenawisdoms commented on August 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.