risk-metrics-calculation

Calculate portfolio risk metrics like VaR, CVaR, and Sharpe Ratio using Python.

1|Updated Feb 7, 2026
One-click install
npx skills add https://github.com/sangrokjung/claude-code-config-public --skill risk-metrics-calculation-sangrokjung
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: risk-metrics-calculation
Source: https://github.com/sangrokjung/claude-code-config-public/tree/main/commands/risk-metrics-calculation
Command: npx skills add https://github.com/sangrokjung/claude-code-config-public --skill risk-metrics-calculation-sangrokjung

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a comprehensive toolkit for calculating and analyzing various risk metrics, enabling users to understand and manage the financial risks associated with their portfolios.

Core Features & Use Cases

  • Risk Metric Calculation: Computes metrics like VaR, CVaR, Sharpe Ratio, Sortino Ratio, Max Drawdown, and more.
  • Portfolio Analysis: Analyzes risk at the portfolio level, including marginal risk contribution and diversification.
  • Stress Testing: Simulates historical and hypothetical crisis scenarios to assess portfolio resilience.
  • Use Case: A portfolio manager can use this Skill to assess the risk-adjusted performance of their holdings, identify potential tail risks, and prepare for market downturns.

Quick Start

Calculate the 95% historical Value at Risk for the provided daily returns series.

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 portfolio risk metrics like VaR and CVaR using Python?

To calculate portfolio risk metrics like VaR and CVaR using Python, this Skill processes daily returns series with NumPy, Pandas, and SciPy to quantify historical Value at Risk and Conditional VaR for your assets.

How do I run stress testing scenarios on my portfolio?

To run stress testing scenarios on your portfolio, this Skill simulates historical and hypothetical crisis events to evaluate portfolio resilience and identify potential tail risks during market downturns.

What is the difference between Sharpe Ratio and Max Drawdown in portfolio analysis?

In portfolio analysis, Sharpe Ratio measures risk-adjusted performance while Max Drawdown evaluates the maximum peak-to-trough loss, and this Skill calculates both to provide a comprehensive view of financial risk.

Can I use NumPy and Pandas to analyze marginal risk contribution for individual assets?

Yes, you can use NumPy and Pandas to analyze marginal risk contribution for individual assets, as this Skill supports both individual asset and portfolio-level risk evaluation to measure diversification.

Does this Skill support calculating Sortino Ratio alongside VaR for daily returns?

Yes, this Skill supports calculating the Sortino Ratio alongside VaR for daily returns, computing various risk metrics including downside deviation and Value at Risk using Python libraries like SciPy.