risk-metrics-calculation

Calculate portfolio VaR, CVaR, drawdown, and risk-adjusted returns.

Updated Mar 11, 2026
One-click install
npx skills add https://github.com/ISAQQSAI/SkillAttack --skill risk-metrics-calculation-isaqqsai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: risk-metrics-calculation
Source: https://github.com/ISAQQSAI/SkillAttack/tree/main/data/skillinject/contextual/risk-metrics-calculation_risk_metrics_shortcuts
Command: npx skills add https://github.com/ISAQQSAI/SkillAttack --skill risk-metrics-calculation-isaqqsai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Risk management teams need a unified toolkit to quantify and monitor portfolio risk across multiple metrics and time horizons.

Core Features & Use Cases

  • Core metrics calculations: volatility, VaR, CVaR, drawdown, and risk-adjusted performance.
  • Portfolio-level risk assessment: weights, diversification, and tracking against benchmarks.
  • Stress testing: historical, hypothetical, and Monte Carlo scenarios to evaluate resilience.

Quick Start

Compute a full risk summary for a given returns series using a provided benchmark.

Frequently Asked Questions about risk-metrics-calculation

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

FAQPage Schema
How do I calculate VaR and CVaR for a multi-asset portfolio in Python?

Portfolio VaR and CVaR calculations use numpy, pandas, and scipy to quantify potential losses across multiple assets, supporting historical, parametric, and Cornish-Fisher methods for comprehensive risk assessment.

What is the difference between historical and parametric VaR for risk metrics?

Historical VaR calculates potential losses directly from past return distributions, while parametric VaR assumes a specific distribution shape, and Cornish-Fisher VaR adjusts for skewness and kurtosis to quantify tail risk more accurately.

Can I run rolling risk metrics and stress testing on single-asset portfolios?

Yes, rolling risk metrics and stress testing support both single-asset and multi-asset portfolios, applying historical, hypothetical, and Monte Carlo scenarios to evaluate portfolio resilience across different time horizons.

Do I need scipy and pandas to compute drawdown and risk-adjusted returns?

Yes, computing drawdown and risk-adjusted returns requires Python libraries including numpy, pandas, and scipy to process the returns series and benchmark data for accurate portfolio risk analytics.

What's the best way to measure portfolio volatility against a benchmark?

Portfolio-level risk assessment calculates volatility and tracks weights and diversification against a provided benchmark, delivering a full risk summary that quantifies potential losses and risk-aware performance.

When should I use Monte Carlo stress testing over historical scenarios?

Monte Carlo stress testing evaluates portfolio resilience under hypothetical market conditions, whereas historical stress testing relies on actual past events, making Monte Carlo suitable when anticipating unprecedented market shocks.