Maintained AlgoGP bridge

QuantStats guide

QuantStats gives any backtest a professional performance report in one line.

Last reviewed

Quick answer

QuantStats is a Python library for portfolio and strategy analytics. Give it a pandas Series of returns and it computes Sharpe, Sortino, Calmar, drawdowns, win rates, monthly return tables and more, draws the standard charts, and writes a complete HTML tear sheet with qs.reports.html(), optionally against a benchmark.

QuantStats at a glance

Category
Portfolio optimization & analytics
Language
Python
License
Apache-2.0
Does
Performance analytics
Markets
Stocks, ETFs, Crypto, Forex, Futures
Best for
Reporting and comparing strategy performance.
In AlgoGP
Built-in bridge: add it to any project

Pick it if

Reporting and comparing strategy performance.

Watch out for

Analytics only.

QuantStats strengths and limitations

Strengths

  • One-line HTML reports.
  • Extensive metric set.
  • Benchmark comparison.

Limitations

  • Analytics only.
  • Benchmark downloads rely on Yahoo Finance.

QuantStats example

pip install quantstats
Install
import quantstats as qs
returns = qs.utils.download_returns("QQQ")
qs.reports.html(returns, benchmark="SPY", output="report.html")
Tear sheet versus SPY.

Use QuantStats with AlgoGP

AlgoGP has a built-in QuantStats bridge. Describe the strategy to the copilot and backtest it in AlgoGP, then open the project’s APIs & keys tab and add QuantStats under Frameworks. The project gains these files, saved as a new version and included in every export:

  • frameworks/algogp_bridge.py
  • frameworks/tests/test_bridge.py
  • frameworks/quantstats_report.py
  • requirements.txt gains: quantstats, pandas
python backtest.py && python frameworks/quantstats_report.py
Run the AlgoGP strategy with QuantStats.

QuantStats: frequently asked questions

Can I get a QuantStats report for an AlgoGP backtest?

Yes: add QuantStats to the project, run python backtest.py, then python frameworks/quantstats_report.py.

QuantStats alternatives

Independent guide. AlgoGP is not affiliated with QuantStats. Features, licenses and maintenance change; check the official documentation. Nothing here is investment advice.

Build a strategy