Skip to content

Quantifies realized risk from historical prices using volatility estimators, drawdown analysis, and downside metrics.

CCM score
62 of 100
skills.sh installs
818
GitHub stars
270
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers annualized close-to-close volatility, Parkinson and Yang-Zhang high-low estimators, and maximum drawdown with duration and recovery time
  • Includes historical VaR, downside deviation, semi-variance, and tracking error, with formulas and worked examples for each measure
  • Warns about annualizing volatility with the square root of time, using 252 trading days, and survivorship bias in price data
  • Designed for analysts who need past risk measures and cross-references performance-metrics, forward-risk, and volatility-modeling

Install

$ npx -y skills add joellewis/finance_skills --skill historical-risk -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Historical Risk Analysis

Core Concepts

Close-to-Close Volatility

The simplest and most common volatility estimator. Compute the standard deviation of log returns and annualize.

sigma_annual = sigma_daily * sqrt(N)

where N = number of trading periods per year (typically 252 for daily, 52 for weekly, 12 for monthly).

Log returns are preferred: r_t = ln(P_t / P_{t-1}).

Parkinson (High-Low) Estimator

Uses intraday high and low prices to capture intraday volatility that close-to-close misses. More efficient than close-to-close when the true process is continuous.

sigma^2_Park = (1 / (4 * n * ln(2))) * sum( ln(H_i / L_i)^2 )

This estimator is roughly 5x more efficient than close-to-close for a diffusion process, but is biased downward when there are jumps or when the range is discretized.

Yang-Zhang Estimator

Combines overnight (close-to-open), open-to-close, and Rogers-Satchell components. It is unbiased for processes with both drift and opening jumps.

sigma^2_YZ = sigma^2_overnight + k * sigma^2_open-to-close + (1 - k) * sigma^2_RS

where k is chosen to minimize estimator variance:

k = 0.34 / (1.34 + (n + 1) / (n - 1))

Details

Repository
github.com/joellewis/finance_skills
Categories
Finance & Trading, Data Science & Analytics
First seen
Jun 3, 2026

Questions

What does the historical-risk skill do for Claude Code?

The historical-risk skill quantifies realized risk from past price data using volatility estimators, drawdown analysis, historical VaR, downside deviation, semi-variance and tracking error. It covers estimators such as Parkinson and Yang-Zhang, plus maximum drawdown and recovery time.

How do I install the historical-risk skill?

Run npx -y skills add joellewis/finance_skills --skill historical-risk -y in a project to install it. Once installed, Claude can answer questions about how risky an investment has been using those historical measures.

Which skills lead the Finance & Trading category next to historical-risk?

In the Finance & Trading category, historical-risk sits alongside wind-mcp-skill, stripe-best-practices, wind-find-finance-skill, convex-billing and create-payment-credential. Its focus is measuring past investment risk from historical data rather than payments or billing.

Does the skill include a script I can run?

Yes, the skill ships a script at scripts/historical_risk.py that you can run with uv run or python3 after installing numpy and scipy. A bare run prints a full risk analysis of the data, including maximum drawdown and 95% and 99% historical VaR.

More from joellewis/finance_skills

All 84

Similar to Historical Risk

More Finance & Trading