Skip to content
Skillpedia
Analysis & spreadsheets41k · #4939

risk-metrics-calculation

Makes your agent calculate investment risk measures. It helps understand how risky a portfolio is.

What it does

This tool calculates various risk measures for your investments. It helps you understand how risky your portfolio is and its potential for losses.

When to use it

  • ✓When you want to know the total risk of your investments.
  • ✓When setting safety limits for your investments.
  • ✓To create a dashboard showing your portfolio's risks.

Example of what to ask your AI

“Calculate the risk metrics for my stock portfolio.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/wshobson/agents/blob/main/plugins/quantitative-trading/skills/risk-metrics-calculation/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/wshobson/agents/blob/main/plugins/quantitative-trading/skills/risk-metrics-calculation/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

The tool analyzes your investment's history to calculate measures like Value at Risk (VaR), which estimates the maximum expected loss, and Drawdown Analysis, which shows the largest percentage drop that has occurred.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add wshobson/agents --skill risk-metrics-calculation

Or download just the file:

curl -L https://raw.githubusercontent.com/wshobson/agents/main/plugins/quantitative-trading/skills/risk-metrics-calculation/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Risk Metrics Calculation

Comprehensive risk measurement toolkit for portfolio management, including Value at Risk, Expected Shortfall, and drawdown analysis.

When to Use This Skill

  • Measuring portfolio risk
  • Implementing risk limits
  • Building risk dashboards
  • Calculating risk-adjusted returns
  • Setting position sizes
  • Regulatory reporting

Core Concepts

1. Risk Metric Categories

Category Metrics Use Case
Volatility Std Dev, Beta General risk
Tail Risk VaR, CVaR Extreme losses
Drawdown Max DD, Calmar Capital preservation
Risk-Adjusted Sharpe, Sortino Performance

2. Time Horizons

Intraday:   Minute/hourly VaR for day traders
Daily:      Standard risk reporting
Weekly:     Rebalancing decisions
Monthly:    Performance attribution
Annual:     Strategic allocation

Detailed patterns and worked examples

Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.

Best Practices

Do's

  • Use multiple metrics - No single metric captures all risk
  • Consider tail risk - VaR isn't enough, use CVaR
  • Rolling analysis - Risk changes over time
  • Stress test - Historical and hypothetical
  • Document assumptions - Distribution, lookback, etc.

Don'ts

  • Don't rely on VaR alone - Underestimates tail risk
  • Don't assume normality - Returns are fat-tailed
  • Don't ignore correlation - Increases in stress
  • Don't use short lookbacks - Miss regime changes
  • Don't forget transaction costs - Affects realized risk
FAQ

What is VaR?

Value at Risk (VaR) is an estimate of the maximum loss your investment might experience over a specific period, with a certain level of confidence.

What is CVaR?

CVaR (Expected Shortfall) is a risk measure that goes beyond VaR, estimating the average loss in scenarios where the loss exceeds the VaR.

Why use multiple risk metrics?

No single metric tells the whole risk story. Using multiple metrics provides a more complete and accurate view of your portfolio's health.

Details

Original description by the author

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.

repo: wshobson/agents

Popularity

GitHub stars
41k
Ranking position
#4939
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills