Open BlackArbsCEO opened 10 months ago
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.
Check out https://github.com/Lumiwealth/quantstats_lumi, which is being updated regularly. We are a fork of this library that is being maintained by Lumiwealth
So far I found cumulative returns, time in market, average drawdown and average drawdown days to be different but there could be others. You can reproduce this issue with the following code: