QuantStats
Python library that turns a series of returns into performance and risk metrics, charts and a full HTML tearsheet, handy for reviewing any backtest or portfolio.
A quick way to see a backtest or portfolio the way analysts do: Sharpe, drawdowns, monthly heatmaps and a shareable HTML report from a few lines of Python.
Who it is for
Python users who already have returns from a backtest, a bot or a portfolio and want clear statistics and charts.
Strengths
- Metrics include Sharpe, Sortino, volatility, win rate, CVaR and the Kelly criterion.
- Charts cover drawdowns, rolling statistics, monthly returns and yearly returns.
- Report modes (metrics, plots, basic, full, html) produce a complete HTML tearsheet.
- Includes Monte Carlo simulations for probabilistic risk analysis.
Good to know
- Metrics work on return series, not individual trades, so trade-level statistics can differ.
- The README says full documentation is still coming soon.
- Needs Python 3.10 or later plus pandas, numpy, scipy, matplotlib, seaborn and yfinance.
- Past statistics describe history only and are illustrative, not a promise of future results.
Custom bots are coming soon
We are preparing a service to build bots on tools like this one. Follow our Telegram channel to know when it opens.
Real-life uses
Backtest tearsheet generator
After every backtest, feed the returns into a script that builds a standard report with drawdowns, monthly returns and risk ratios, so you compare strategies on the same page. Illustrative only, never a promise of returns.
Compare it with others
Guides that use it
Quick answers
How much does QuantStats cost?
Free and open source. Prices change, so check the official website before you decide.
Is QuantStats open source?
Yes. License: Apache-2.0.
Who is QuantStats for?
Python users who already have returns from a backtest, a bot or a portfolio and want clear statistics and charts.
What is QuantStats written in?
QuantStats is written in Python.
What should I know before using QuantStats?
Metrics work on return series, not individual trades, so trade-level statistics can differ. The README says full documentation is still coming soon. Needs Python 3.10 or later plus pandas, numpy, scipy, matplotlib, seaborn and yfinance. Past statistics describe history only and are illustrative, not a promise of future results.
Want a bot like this when custom bots open? Get notified · All comparisons · Guides
Sources
Every fact on this page comes from these sources, checked on 2026-11-25. If something has changed, the source wins.
- https://github.com/ranaroussi/quantstats: features, modules, install command, requirements, limitations
- https://api.github.com/repos/ranaroussi/quantstats: Apache-2.0 license, about 7,900 stars, active (last push 2026-11-02), not archived
Alternatives in Backtesting
Backtrader
Classic Python library for backtesting strategies, widely used in tutorials.
bt
Python library to backtest portfolio strategies (allocation, weighting, rebalancing) built from reusable building blocks.
PyBroker
Python framework for backtesting trading strategies, especially machine-learning ones, with a Numba-accelerated engine and walk-forward analysis.
PyPortfolioOpt
Python library for portfolio optimization, with mean-variance, Black-Litterman and Hierarchical Risk Parity methods, several risk models and discrete allocation into whole shares.