historical-risk
Quantify how risky an investment has been using historical price data. This skill computes annualized volatility, maximum drawdown, recovery time, historical VaR, downside deviation, and tracking error—supporting multiple volatility estimators including Parkinson and Yang-Zhang methods. Use it to analyze peak-to-trough losses and asymmetric downside risk.
historical-risk quantifies realized volatility and drawdown from past price data using multiple estimators and downside metrics.
AI-generated summary based on this skill's SKILL.md
Install
JoelLewis/finance_skills/historical-risk · repository language: Python
git clone https://github.com/JoelLewis/finance_skills
cp -r finance_skills/plugins/wealth-management/skills/historical-risk ~/.claude/skills/historical-riskFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How to calculate historical volatility with historical-risk?
historical-risk computes annualized volatility from past price data using log returns and standard deviation. It supports multiple estimators: standard deviation from daily returns, Parkinson's high-low method for intraday volatility, and Yang-Zhang's range-based approach. Choose the method that best fits your data frequency and asset class.
What is maximum drawdown and how does historical-risk measure it?
historical-risk analyzes maximum drawdown as the peak-to-trough decline from the highest portfolio value to its lowest subsequent point. The skill also calculates recovery time—how long it took to return to the previous peak—and drawdown duration, giving you a complete picture of worst historical declines and the time needed to recover.
How does historical-risk calculate historical VaR and downside risk?
historical-risk computes historical Value at Risk (VaR) by analyzing past returns to estimate losses at a given confidence level (e.g., 95%). It also measures downside deviation and semi-variance, which focus only on returns below a threshold, capturing asymmetric downside risk that standard volatility misses.
Can historical-risk compare my portfolio performance to a benchmark?
Yes. historical-risk calculates tracking error—the standard deviation of differences between your portfolio returns and benchmark returns. This metric shows how much your portfolio deviates from its benchmark, helping you assess active management risk and consistency relative to your chosen index.
What advanced volatility estimators does historical-risk support?
historical-risk supports Parkinson's estimator, which uses high-low price ranges for efficient intraday volatility estimation, and Yang-Zhang's volatility estimator, which combines overnight gaps and intraday ranges. These advanced methods are particularly useful for assets with significant intraday trading ranges or overnight gaps.
How risky has an investment been using historical-risk analysis?
historical-risk quantifies realized investment risk by combining multiple metrics: annualized volatility shows price variability, maximum drawdown reveals worst-case losses, recovery time indicates resilience, and historical VaR estimates tail risk. Together, these metrics provide a comprehensive view of how risky the investment has been historically.
SKILL.md
rendered from the published skill — quoted content, verbatim
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 /
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 2 files
plugins/wealth-management/skills/historical-risk/SKILL.md
plugins/wealth-management/skills/historical-risk/scripts/historical_risk.py