home / skills / sickn33 / antigravity-awesome-skills / risk-metrics-calculation
This skill helps you measure portfolio risk with VaR, CVaR, Sharpe, drawdown analysis and risk-adjusted insights for dashboards and limits.
npx playbooks add skill sickn33/antigravity-awesome-skills --skill risk-metrics-calculationReview the files below or copy the command above to add this skill to your agents.
---
name: risk-metrics-calculation
description: Calculate portfolio risk metrics including VaR, CVaR, Sharpe, Sortino, and drawdown analysis. Use when measuring portfolio risk, implementing risk limits, or building risk monitoring systems.
---
# Risk Metrics Calculation
Comprehensive risk measurement toolkit for portfolio management, including Value at Risk, Expected Shortfall, and drawdown analysis.
## Use this skill when
- Measuring portfolio risk
- Implementing risk limits
- Building risk dashboards
- Calculating risk-adjusted returns
- Setting position sizes
- Regulatory reporting
## Do not use this skill when
- The task is unrelated to risk metrics calculation
- You need a different domain or tool outside this scope
## Instructions
- Clarify goals, constraints, and required inputs.
- Apply relevant best practices and validate outcomes.
- Provide actionable steps and verification.
- If detailed examples are required, open `resources/implementation-playbook.md`.
## Resources
- `resources/implementation-playbook.md` for detailed patterns and examples.
This skill calculates core portfolio risk metrics—Value at Risk (VaR), Conditional VaR (CVaR/Expected Shortfall), Sharpe and Sortino ratios, and drawdown analysis—to quantify downside exposure and risk-adjusted performance. It is implemented in Python and designed for integration into risk dashboards, limit systems, and portfolio analytics pipelines. The outputs are numeric metrics and time-series summaries ready for reporting or automated checks.
Given portfolio returns, positions, or simulated P&L paths, the skill computes VaR and CVaR using historical, parametric (variance-covariance), or Monte Carlo methods. It also computes Sharpe and Sortino ratios from realized returns and performs drawdown detection (peak-to-trough, max drawdown, drawdown duration). Results include point estimates, confidence intervals where applicable, and diagnostic checks for model assumptions.
Which VaR method should I use?
Use historical VaR when you trust observed return history, parametric VaR for speed when returns are near-normal, and Monte Carlo when you need scenario flexibility or non-linear exposures.
How is Sortino different from Sharpe?
Sortino uses downside deviation (negative returns) instead of total volatility, so it penalizes harmful volatility and better reflects downside risk-adjusted performance.