Giter VIP home page Giter VIP logo

Comments (1)

timnilson avatar timnilson commented on May 26, 2024

The below is probably a different issues if your values are totally different, but here goes...

I have been finding that the call to:

metrics = qs.reports.metrics(returns, display=False, sep=False, mode="full")

Gives you values that are rounded. Max Drawdown for example comes back as -0.08 if the drawdown was -8.38% for example. I have been unable to find any option that would change the output values so they are not rounded. What you can do is can pass internal=True like:

metrics = qs.reports.metrics(returns, display=False, sep=False, mode="full", internal=True)

But, this will return strings of numbers used in the HTML report. So, for Max Drawdown for example you would get back "-8.3%", which is better than -0.08. But since this is a string, also not exactly what you want.

You could use the qs.stats method to return un-rounded values, but that is less elegant as you need to know all the key names for each stat. For instance, you could call:

mdd = qs.stats.max_drawdown()

This will get you the full value, which you can then round / multiply how you want. I was hoping I could get the the qs.metrics method to return all the un-rounded values.

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.