risk-metrics-calculation

Calculate financial risk metrics for assets and portfolios.

4|Updated Jan 10, 2026
One-click install
npx skills add https://github.com/EngineerWithAI/engineerwith-agents --skill risk-metrics-calculation-engineerwithai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: risk-metrics-calculation
Source: https://github.com/EngineerWithAI/engineerwith-agents/tree/main/plugins/quantitative-trading/skills/risk-metrics-calculation
Command: npx skills add https://github.com/EngineerWithAI/engineerwith-agents --skill risk-metrics-calculation-engineerwithai

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 for financial portfolios, enabling better risk management and decision-making.

Core Features & Use Cases

  • Risk Metric Calculation: Compute metrics like VaR, CVaR, Sharpe Ratio, Sortino Ratio, Max Drawdown, and more.
  • Portfolio Analysis: Analyze risk contributions, diversification, and correlations within a portfolio.
  • Stress Testing: Perform historical and hypothetical stress tests to understand potential losses under adverse conditions.
  • Use Case: A portfolio manager needs to assess the risk exposure of their holdings. They can use this Skill to calculate the 95% VaR, maximum drawdown, and Sharpe ratio for their portfolio to understand its risk-return profile.

Quick Start

Calculate the summary risk metrics 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 VaR and CVaR for my portfolio's daily returns?

To calculate VaR and CVaR, you input your daily returns series to compute summary risk metrics. The calculation evaluates volatility and tail risk to quantify potential portfolio losses at specific confidence intervals.

What is the best way to stress test a portfolio under historical and hypothetical scenarios?

Portfolio stress testing is performed by simulating adverse market conditions against your current holdings. The calculation evaluates historical events and hypothetical scenarios to measure potential capital losses and portfolio vulnerability.

How does marginal risk contribution and risk parity weighting work in portfolio analysis?

Marginal risk contribution identifies how much each individual asset adds to total portfolio volatility. Risk parity weights are then calculated to equalize risk contributions across assets, ensuring balanced diversification rather than equal capital allocation.

Can I compute rolling window risk metrics like Sharpe and Sortino ratios?

Yes, you can compute rolling window calculations for Sharpe and Sortino ratios. This evaluates risk-adjusted returns over moving time periods, capturing dynamic performance changes rather than relying on static full-period averages.

Does this portfolio risk analysis support individual assets alongside entire portfolios?

Yes, the risk metric calculation supports both individual assets and entire portfolios. You can evaluate standalone volatility and drawdowns for single assets, or aggregate metrics like diversification ratios and correlations for complete portfolios.