portfolio-analytics

Computes portfolio-level return, risk, and drawdown metrics from equity curves and trade logs, optionally generating quantstats HTML reports.

1|Updated May 15, 2026
One-click install
npx skills add https://github.com/dnkrow/skill --skill portfolio-analytics-dnkrow
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: portfolio-analytics
Source: https://github.com/dnkrow/skill/tree/main/claude-global/portfolio-analytics
Command: npx skills add https://github.com/dnkrow/skill --skill portfolio-analytics-dnkrow

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pandas, numpy, quantstats, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Portfolio managers and traders often lack a consistent, reproducible way to measure performance quality, compare strategies, and understand risk through time (returns, drawdowns, and risk-adjusted ratios).

Core Features & Use Cases

  • Portfolio-level performance measurement: Computes total return, CAGR, volatility, VaR/CVaR, maximum drawdown, and time underwater from an equity curve.
  • Risk-adjusted performance ratios: Calculates Sharpe, Sortino, Calmar, Omega, and Information ratio (with optional benchmark comparison).
  • Rolling and distributional analysis: Produces rolling Sharpe and monthly/yearly return tables to spot regimes and consistency.
  • Trade-level statistics: Summarizes win rate, average win/loss, profit factor, and expectancy from trade PnL series.
  • Investor-ready reporting: Supports automated HTML report generation via quantstats and provides end-to-end script workflows (single portfolio analysis and multi-strategy comparison).

Quick Start

Use the attached equity CSV to generate a full set of portfolio analytics by running the analyze script in demo mode: python scripts/analyze_portfolio.py --demo

Frequently Asked Questions about portfolio-analytics

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compute portfolio performance and risk metrics from an equity curve?

Portfolio performance and risk metrics are computed by processing equity curves and optional trade logs to calculate total return, CAGR, volatility, VaR, CVaR, maximum drawdown, and time underwater, producing consistent evaluation outputs for strategies.

Can I generate a quantstats HTML report from my backtesting equity curve?

Yes, you can generate a quantstats HTML report from a backtesting equity curve by aligning your returns series, which enables automated investor-ready HTML report generation including rolling-window analytics and drawdown analysis.

What's the best way to compare multiple trading strategies against a benchmark?

The best way to compare multiple trading strategies against a benchmark is to calculate risk-adjusted ratios like Sharpe, Sortino, Calmar, and Information ratio across aligned returns series, which multi-strategy comparison workflows provide for benchmark-aligned assessments.

How do I calculate rolling Sharpe ratio and drawdown analysis for a portfolio?

Calculating rolling Sharpe ratio and drawdown analysis for a portfolio involves applying rolling-window analytics to equity curve data, producing monthly and yearly return tables that help spot performance regimes and measure consistency over time.

Does this portfolio analytics tool work with trade logs to calculate win rate and profit factor?

Yes, this portfolio analytics tool works with optional trade logs to calculate trade-level statistics, summarizing win rate, average win/loss, profit factor, and expectancy directly from provided trade PnL series.