risk-metrics-calculation

Compute VaR, CVaR, drawdowns, and risk-adjusted metrics from return series.

Updated Mar 18, 2026
One-click install
npx skills add https://github.com/ekremmkasap/jarvis --skill risk-metrics-calculation-ekremmkasap
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: risk-metrics-calculation
Source: https://github.com/ekremmkasap/jarvis/tree/main/server/agent_prompts/wshobson/plugins/quantitative-trading/skills/risk-metrics-calculation
Command: npx skills add https://github.com/ekremmkasap/jarvis --skill risk-metrics-calculation-ekremmkasap

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This risk metrics toolkit helps quantify portfolio risk using VaR, CVaR, drawdown, and risk-adjusted measures, enabling clearer risk reporting and informed decision-making.

Core Features & Use Cases

  • Compute VaR (historical, parametric, and Cornish-Fisher) to gauge potential losses under different assumptions.
  • Calculate CVaR, drawdown metrics (max drawdown, drawdown duration), and risk-adjusted returns (Sharpe, Sortino, Calmar, Omega) for performance attribution.
  • Support portfolio level analysis, rolling risk metrics, and stress-testing scenarios to monitor and manage risk in dynamic markets.

Quick Start

Provide a time series of periodic returns and optional benchmark data to obtain a full risk summary, including VaR, CVaR, drawdown, and risk-adjusted metrics.

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 portfolio of returns?

To calculate VaR and CVaR for a portfolio, provide a time series of numeric periodic returns. The toolkit computes historical, parametric, and Cornish-Fisher VaR alongside CVaR to quantify potential portfolio losses under different assumptions.

What are the best risk-adjusted metrics for evaluating portfolio performance?

Key risk-adjusted metrics for portfolio performance include Sharpe, Sortino, Calmar, and Omega ratios. These metrics evaluate returns relative to risk exposure, accounting for volatility and downside deviation to provide performance attribution.

Can I compute rolling risk metrics and stress-test a multi-asset portfolio?

Yes, you can compute rolling risk metrics and run stress-testing scenarios for multi-asset portfolios. The calculation supports dynamic market monitoring by applying configurable annualization and horizons across your input returns.

How do I measure maximum drawdown and drawdown duration from a returns series?

To measure maximum drawdown and drawdown duration, input your numeric returns series. The toolkit calculates the peak-to-trough decline and the duration of the recovery period to quantify portfolio risk exposure.

What data format do I need to calculate portfolio risk metrics?

You need a time series of numeric periodic returns as input data, along with optional benchmark data. The calculations use numpy, pandas, and scipy to process the returns and generate a full risk summary.

Does portfolio risk calculation support single-asset analysis or only multi-asset portfolios?

Portfolio risk calculation supports both single-asset and multi-asset portfolios. It computes VaR, CVaR, drawdowns, and risk-adjusted metrics across rolling and stress-testing scenarios for either asset scope.