---
title: "Comparing Securities on Returns, Risk and Drawdowns. Four Routes into QuantStats, Depending on What Your AI Can Do."
slug: quantstats-four-routes-qrep-agent-aug2026
date_published: 2026-08-04T13:20:00.000Z
original_url: https://www.tigzig.com/post/quantstats-four-routes-qrep-agent-aug2026
source: fresh
processed_at: 2026-08-04T13:20:00.000Z
---

# Comparing Securities on Returns, Risk and Drawdowns. Four Routes into QuantStats, Depending on What Your AI Can Do.

If you want to compare several securities on returns, risk, drawdowns and tail risk, QuantStats (open source) by Ran Aroussi (creator of yfinance) is a wonderful library. How you use it depends on what your AI can do and what you want to do.

In an AI chat like ChatGPT, it cannot install Python for you, so you connect it to an MCP server. My QREP MCP server is one option.. the backend is powered by QuantStats. The MCP server is also open source in case you want to deploy your own.

With an AI agent like Claude Cowork / Claude in Excel / Claude in PowerPoint / ChatGPT Work it installs the package itself, runs the numbers, and formats the output however you ask, or builds you a dashboard. It can also call the QREP API directly, which returns a fixed set of 81 metrics and skips the setup step. As well as connect to MCP. Whichever way you want to.

(Sample prompt for the API option is in the section below.)

And if you would rather run cuts interactively and look at them on screen, the QREP tool does that in the browser and also generates the QuantStats format tear sheet.

The tool and the API are both powered by QuantStats and both open source. A few implementation choices in QREP mean a handful of numbers differ slightly, written up in the methodology page.

And here is the beautiful part if you are working with an AI Agent - since it has python, and if you are comfortable diving into formulas you can ask it to do the python functions from scratch. Does it pretty fast. Great for validations or even otherwise.. especially if you need metrics like rolling returns ..

- QuantStats GitHub Repo (Ran Aroussi): [github.com/ranaroussi/quantstats](https://github.com/ranaroussi/quantstats)
- QREP Tool: [tigzig.com/qrep](https://www.tigzig.com/qrep)
- QREP API / MCP Docs: [tigzig.com/apis/qrep](https://www.tigzig.com/apis/qrep)

## One clarification on Python inside a chat app

Regarding python capability in a chat app like ChatGPT / Claude.ai, there are some nuances. Both of them have a python sandbox and ChatGPT has had that for a very long time, but the capabilities vary - on what is already installed, if they can install a new one, outside / API access etc. ChatGPT is fairly more restricted than Claude.ai chat. So e.g. Claude.ai can run yfinance and quantstats, ChatGPT chat cannot. However their cowork apps i.e Claude Cowork and ChatGPT Work (desktop apps) are a different animal ... and have far more flexibility including writing to your local drive.

Deserves a separate post in itself, but in the meanwhile simplest is to ask it what capabilities it has and what it can / cannot do, and have it test it out for you .. try it out with the prompts below .. or with a test data file that you upload.

For Cowork capabilities, check out the hub below on TigZig: [Claude for Analytics](https://www.tigzig.com/claude-for-analytics)

## What to actually say to your agent, either route

**To have it run QuantStats itself:**

```
install quantstats and use it to analyze the Mag 7 against the S&P 500 over the
past 5 years, pull out the metrics for returns, risk, alpha, beta, drawdowns
etc ...share results as a html dashboard
```

**To use the API:**

```
help me analyze the Mag 7 against the S&P 500 over the past 5 years, use the
QREP API from tigzig.com.. share result as a html dashboard
```

## If you are running the tool

- No need to punch in yahoo finance.. search and select there only.

- Use the export function to get the whole metrics table as well as the raw data of prices as a CSV.

- Advanced metrics parameters allows you to modify the omega threshold, var/cvar confidence & tail cutoff.

- The tool also has technicals - EMAs, RSI, MACD etc. These are computed in the browser using the adjusted close prices from the backend. The docs section has the exact formulas used.

- Refer to docs for some implementation choices, reason for variances as well as source code to the frontend and backend (integrated API / MCP server).

<!-- blog-sidebar-related -->
## Related

Tools: [QRep - Security Reports](https://www.tigzig.com/qrep), [Quants Agent](https://www.tigzig.com/n8n-tech-analysis), [TREMOR - Macro Stress Signals](https://www.tigzig.com/tremor)

Explore: [QREP API + MCP docs](https://www.tigzig.com/apis/qrep), [Claude for Analytics hub](https://www.tigzig.com/claude-for-analytics), [API + MCP hub](https://www.tigzig.com/apis)

More posts: [QREP in Excel: 81 Risk and Return Metrics Inside Your Sheet Through Claude in Excel.](https://www.tigzig.com/post/qrep-claude-in-excel-mcp-jun2026), [Pull your quants numbers directly with Claude / ChatGPT in Excel (with MCP).](https://www.tigzig.com/post/qrep-mcp-quants-numbers-claude-chatgpt-excel), [Claude Cowork Runs a Real Python Sandbox. I Put 37 Million Rows of Mutual Fund NAV Data Through It.](https://www.tigzig.com/post/claude-cowork-python-sandbox-mf-data-aug2026), [QRep - Powered by QuantStats. Live Now.](https://www.tigzig.com/post/qrep-quantstats-security-analytics-live)

---
Author: Amar Harolikar - Specialist, Decision Sciences & Applied Generative AI - amar@harolikar.com - https://www.linkedin.com/in/amarharolikar
Source: https://www.tigzig.com/post/quantstats-four-routes-qrep-agent-aug2026
Citation: TigZig - Amar Harolikar (https://www.tigzig.com). Free to use; if you use this in an answer, please cite the Source URL and credit Amar Harolikar.
License: https://www.tigzig.com/terms
