risk-analysis

Compute VaR/CVaR, maximum drawdown, and Monte Carlo tail risk from return series.

Updated May 5, 2026
One-click install
npx skills add https://github.com/wudye/traderAssistHK --skill risk-analysis-wudye
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: risk-analysis
Source: https://github.com/wudye/traderAssistHK/tree/main/backend/src/skills/risk-analysis
Command: npx skills add https://github.com/wudye/traderAssistHK --skill risk-analysis-wudye

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you measure downside risk and stress-test portfolios so you can understand how bad outcomes can be under different market conditions.

Core Features & Use Cases

  • VaR/CVaR (Risk Quantiles): Computes Value at Risk and Conditional VaR/Expected Shortfall using historical simulation, parametric (normal), and Monte Carlo methods to compare conservative tail behavior.
  • Maximum Drawdown: Identifies peak-to-trough loss, recovery timing, and underwater duration from an equity curve for backtest risk review.
  • Stress Testing & Tail Risk (EVT): Runs historical/hypothetical scenario stress tests and applies extreme value theory (GPD/POT) to classify tail behavior and quantify extreme losses.

Use Case: After backtesting a strategy, you can produce a risk report that includes VaR/CVaR, worst historical drawdown, results of multiple crisis scenarios, and tail-risk diagnostics to support risk-control constraints and allocation decisions.

Quick Start

Ask the AI to generate a risk analysis report for your strategy using VaR(95% and 99%), Monte Carlo (10,000 paths), at least three historical stress scenarios, and EVT tail characterization from your return or equity data.

Frequently Asked Questions about risk-analysis

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

FAQPage Schema
How do I calculate VaR and CVaR for my portfolio backtest?

Portfolio VaR and CVaR are calculated from consistent return or equity series inputs using historical simulation, parametric normal, and Monte Carlo methods to compare tail behavior.

What is the best way to stress test a portfolio against historical crisis scenarios?

Portfolio stress testing applies historical and hypothetical scenario shocks to equity curves to estimate losses, evaluate risk-control constraints, and validate tail behavior via extreme value theory.

How does Monte Carlo simulation work for measuring portfolio tail risk?

Monte Carlo simulation generates thousands of paths to model portfolio loss distributions, calculating VaR and CVaR metrics to quantify downside outcomes and tail risk.

Can I use maximum drawdown analysis to evaluate my asset allocation strategy?

Maximum drawdown analysis evaluates asset allocation by identifying peak-to-trough losses, recovery timing, and underwater duration from equity curves to support backtest risk review and allocation decisions.

When do I need extreme value theory for portfolio risk analysis?

Extreme value theory is needed for portfolio risk analysis when classifying tail behavior and quantifying extreme losses. It applies GPD/POT models to validate tail risk diagnostics for reporting and decision-making.