Quantifies how risky an asset or portfolio has actually been using historical data. You get volatility estimators ranging from simple close-to-close to the more sophisticated Yang-Zhang that uses OHLC data, plus drawdown analysis with max drawdown and recovery times, historical VaR pulled straight from the empirical distribution, and downside risk metrics like semi-variance and tracking error. The formulas are all here with worked examples. One thing to watch: these are all backward-looking measures, so you're assuming the past tells you something useful about risk, which works great until the regime changes. Pairs naturally with performance metrics since most risk-adjusted ratios need a volatility or drawdown number in the denominator.

skills.sh installs
761
GitHub stars
224
last updated
Aug 21, 2026

Install

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

Installs into .claude/skills of the current project.

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))

Sponsors

Details

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

More from joellewis/finance_skills

All 84

Recommended

More Debugging
1ruvnet avatarruflo-doctorruvnet/rufloRun health checks on the Ruflo installation and fix common issues755skills.sh installs
2hyva-themes avatarhyva-cms-components-dumphyva-themes/hyva-ai-toolsDump all Hyvä CMS components from active modules. This skill should be used when the user wants to list all CMS components, view available components, debug com751skills.sh installs
3zxkane avataraws-mcp-setupzxkane/aws-skillsConfigure AWS MCP servers for documentation search and API access. Use when setting up AWS MCP, configuring AWS documentation tools, troubleshooting MCP connect747skills.sh installs
4daymade avatarterraform-skilldaymade/claude-code-skillsOperational traps for Terraform provisioners, multi-environment isolation, and zero-to-deployment reliability. Use when writing null_resource / remote-exec / lo746skills.sh installs
5syncfusion avatarsyncfusion-react-licensesyncfusion/react-ui-components-skillsUse this skill when the user asks about Syncfusion React licensing, license keys, license registration, license validation errors, trial licenses, or license tr744skills.sh installs
6mohitmishra786 avatarcross-gccmohitmishra786/low-level-dev-skillsCross-compilation with GCC skill for embedded and multi-architecture targets. Use when setting up cross-gcc toolchains, configuring sysroots, building for ARM/A742skills.sh installs