risk-metrics-calculation

Calculate VaR, CVaR, Sharpe, and drawdowns from historical return data.

1|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/Sumeet138/qwen-code-agents --skill risk-metrics-calculation-sumeet138
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: risk-metrics-calculation
Source: https://github.com/Sumeet138/qwen-code-agents/tree/main/plugins/quantitative-trading/skills/risk-metrics-calculation
Command: npx skills add https://github.com/Sumeet138/qwen-code-agents --skill risk-metrics-calculation-sumeet138

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Calculate and interpret portfolio risk metrics to quantify volatility, tail risk, drawdowns, and risk-adjusted performance for informed decision-making.

Core Features & Use Cases

  • VaR (historical, parametric, and Cornish-Fisher) and CVaR for tail-risk assessment
  • Drawdown analysis, Omega and Calmar ratios, and Sharpe/Sortino for risk-adjusted performance
  • Rolling risk analytics, stress testing (historical and hypothetical), and benchmark comparisons for risk budgeting and monitoring

Quick Start

Provide a time series of returns to compute VaR, CVaR, Sharpe, and drawdowns and generate a risk summary.

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 from historical returns?

To calculate portfolio risk metrics, provide a time series of historical returns to compute Value at Risk (VaR), Conditional VaR (CVaR), volatility, and drawdowns, generating a risk summary across intraday to annual horizons.

What is the difference between Sharpe, Sortino, and Calmar ratios for risk-adjusted performance?

Sharpe, Sortino, and Calmar ratios measure risk-adjusted performance by comparing returns against different risk denominators. The skill calculates all three alongside Omega ratios, enabling you to evaluate portfolio performance using volatility, downside deviation, and maximum drawdown respectively.

Can I perform rolling risk analytics and stress testing on portfolio returns?

Yes, you can perform rolling risk analytics and stress testing on portfolio returns. The skill implements historical and hypothetical stress testing utilities, allowing you to monitor risk exposure over dynamic time windows and evaluate portfolio resilience under adverse market scenarios.

Does portfolio risk calculation support benchmark comparisons for risk budgeting?

Portfolio risk calculation supports optional benchmark comparisons for risk budgeting and monitoring. You can compare your portfolio's risk metrics against a benchmark to evaluate relative performance, allocate risk budgets, and generate comparative risk reports for dashboards.

What data do I need to start measuring portfolio drawdowns and tail risk?

To start measuring portfolio drawdowns and tail risk, you need a time series of historical return data. The skill processes this input to compute drawdown analysis, VaR, and CVaR, applicable across intraday to annual horizons for automated monitoring and reporting.

When should I use historical VaR versus parametric VaR for portfolio risk assessment?

Use historical VaR for portfolio risk assessment when you want to rely on actual empirical return distributions, and use parametric VaR when you assume returns follow a normal distribution. The skill also offers Cornish-Fisher VaR to adjust for skewness and kurtosis in return data.