
Historical Risk
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-codeInstalls 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- Liquidity Management756
- Bet Sizing755
- Time Value Of Money754
- Account Transfers753
- Volatility Modeling753
- Financial Planning Workflow751
- Emergency Fund748
- Performance Metrics746
- Data Quality745
- Return Calculations745
- Lending741
- Savings Goals741
- Trade Execution739
- Fund Vehicles737
- Forward Risk733
- Privacy Data Security731
- Performance Reporting729
- Equities727
- Tax Efficiency724
- Anti Money Laundering723
- Financial Planning Integration723
- Advertising Compliance722
- Fixed Income Corporate722
- Portfolio Management Systems721