portfolio-analytics
Portfolio Analytics calculates comprehensive performance metrics from equity curves and trade logs, including returns, volatility, value-at-risk, Sharpe and Sortino ratios, maximum drawdown, and trade-level statistics. Generate rolling analysis windows and investor-ready performance summaries to evaluate strategy performance against benchmarks.
Portfolio Analytics computes performance metrics, risk ratios, and drawdown analysis from equity curves and trade logs.
AI-generated summary based on this skill's SKILL.md
Install
agiprolabs/claude-trading-skills/portfolio-analytics · repository language: Python
git clone https://github.com/agiprolabs/claude-trading-skills
cp -r claude-trading-skills/skills/portfolio-analytics ~/.claude/skills/portfolio-analyticsFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
What portfolio performance metrics can Portfolio Analytics calculate?
Portfolio Analytics calculates comprehensive performance metrics including returns, volatility, value-at-risk (VaR), Sharpe ratio, Sortino ratio, Calmar ratio, maximum drawdown, CAGR, and trade-level statistics. The skill analyzes equity curves and trade logs to generate risk-adjusted ratios and rolling performance windows for thorough strategy evaluation.
How does Portfolio Analytics generate investor-ready reports?
Portfolio Analytics uses quantstats to generate professional HTML reports suitable for investor presentations. These reports include performance summaries, risk metrics, drawdown analysis, monthly and yearly return attribution tables, and benchmark comparisons—all formatted for easy interpretation by stakeholders.
Can Portfolio Analytics compare multiple strategies using risk-adjusted ratios?
Yes, Portfolio Analytics compares multiple strategies using risk-adjusted performance metrics including Sharpe ratio, Sortino ratio, information ratio, alpha, beta, and tracking error. This enables ranking and comparison of strategies to identify which delivers superior risk-adjusted returns relative to benchmarks.
What drawdown and volatility analysis does Portfolio Analytics provide?
Portfolio Analytics analyzes maximum drawdown, underwater time, rolling volatility windows, and rolling drawdown periods. It examines equity curve behavior to identify peak-to-trough declines and volatility patterns, helping assess strategy resilience during market stress periods.
How does Portfolio Analytics evaluate trade-level statistics and benchmark performance?
Portfolio Analytics extracts trade-level statistics including win rate and profit factor from trade logs. It compares strategy performance against benchmarks using alpha, beta, and tracking error to quantify outperformance and systematic risk exposure relative to market indices.
What is the license for Portfolio Analytics?
Portfolio Analytics is released under the MIT license, allowing free use, modification, and distribution for both commercial and non-commercial purposes with minimal restrictions.
SKILL.md
rendered from the published skill — quoted content, verbatim
Portfolio Analytics
Compute portfolio-level performance metrics from equity curves and trade logs. Covers return metrics, risk metrics, risk-adjusted ratios, drawdown analysis, rolling windows, benchmark comparison, trade-level statistics, and automated HTML report generation via quantstats.
When to Use This Skill
- After backtesting a strategy (e.g., from
vectorbtorstrategy-framework) - Comparing multiple strategies or parameter sets side-by-side
- Generating investor-ready performance reports
- Evaluating live trading performance against benchmarks
- Assessing risk-adjusted returns for portfolio allocation decisions
Prerequisites
uv pip install pandas numpy quantstats
Input Format
All analytics start from an equity curve — a time-indexed Series of portfolio values:
```python import pandas as pd import numpy as np
From a backtest
equity = pd.Series( [10000, 10150, 10080, 10320, 10510, 10440, 10680], index=pd.date_range("2025-01-01", periods=7,
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 5 files
skills/portfolio-analytics/SKILL.md
skills/portfolio-analytics/references/metrics_guide.md
skills/portfolio-analytics/references/quantstats_guide.md
skills/portfolio-analytics/scripts/analyze_portfolio.py
skills/portfolio-analytics/scripts/compare_strategies.py