risk-analysis

Calculate VaR, CVaR, and maximum drawdown with Monte Carlo simulations.

Updated Jun 30, 2026
One-click install
npx skills add https://github.com/20YN04/vibe-trading-macos --skill risk-analysis-20yn04
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: risk-analysis
Source: https://github.com/20YN04/vibe-trading-macos/tree/main/agent/src/skills/risk-analysis
Command: npx skills add https://github.com/20YN04/vibe-trading-macos --skill risk-analysis-20yn04

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, pandas, scipy.

What problem does it solve?

This Skill addresses the difficulty of accurately measuring financial risk and predicting portfolio performance under extreme market conditions, helping users move beyond simple volatility metrics.

Core Features & Use Cases

  • Advanced Risk Metrics: Calculate VaR (Value at Risk), CVaR (Expected Shortfall), and Maximum Drawdown to understand potential losses.
  • Simulation & Stress Testing: Run Monte Carlo simulations and historical scenario stress tests to evaluate portfolio resilience against market shocks.
  • Use Case: A trader can use this to determine if their current portfolio allocation would survive a 2008-style financial crisis or a sudden liquidity dry-up.

Quick Start

Use the risk-analysis skill to calculate the 95 percent VaR and perform a stress test on the provided portfolio return series.

Frequently Asked Questions about risk-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I calculate Value at Risk and expected shortfall for a portfolio?

To calculate Value at Risk (VaR) and Expected Shortfall (CVaR), you apply statistical modeling to historical asset return series. These quantitative risk metrics measure potential portfolio losses and identify vulnerabilities beyond simple volatility.

How do I stress test my portfolio against historical market shocks?

To stress test your portfolio against historical market shocks, you apply historical scenario simulations to your asset return series. This evaluates portfolio resilience by modeling extreme market conditions like a financial crisis or liquidity dry-up.

Can I run Monte Carlo simulations for financial risk analysis using Python?

Yes, you can run Monte Carlo simulations for financial risk analysis using Python libraries like numpy, pandas, and scipy. These dependencies execute the statistical modeling required to simulate asset returns and predict portfolio performance under extreme conditions.

Does this risk analysis approach detect fat-tail risks in asset returns?

Yes, this risk analysis approach detects fat-tail risks in asset returns by applying extreme value theory and statistical modeling. It identifies severe loss probabilities that standard volatility metrics often miss during sudden market shocks.

What is the best way to measure maximum drawdown for a trading portfolio?

The best way to measure maximum drawdown for a trading portfolio is through quantitative analysis of asset return series. This calculates the maximum observed loss from a peak to a trough, highlighting portfolio vulnerabilities before they occur.

Do I need numpy and scipy to perform Monte Carlo stress testing?

Yes, you need numpy, pandas, and scipy to perform Monte Carlo stress testing. These Python dependencies are required to execute the statistical modeling and extreme value theory analysis necessary for accurate financial risk measurement.