# Volatility Modeling

Volatility estimation, forecasting, and regime classification using GARCH, EWMA...

- Repository: https://github.com/agiprolabs/claude-trading-skills (507 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-09-03
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add agiprolabs/claude-trading-skills --skill volatility-modeling -g -a claude-code -y`
Codex: `npx skills add agiprolabs/claude-trading-skills --skill volatility-modeling -g -a codex -y`
Cursor: `npx skills add agiprolabs/claude-trading-skills --skill volatility-modeling -g -a cursor -y`
Gemini CLI: `npx skills add agiprolabs/claude-trading-skills --skill volatility-modeling -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add agiprolabs/claude-trading-skills`

## Description

Volatility estimation, forecasting, and regime classification using GARCH, EWMA, realized volatility, and volatility cones

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Volatility Modeling

Volatility, the magnitude of price fluctuations, is arguably the single most
important quantity in trading.  It drives position sizing, stop placement, option
pricing, and regime detection.  This skill covers estimation, forecasting, and
practical application of volatility in crypto markets.

## Why Volatility Matters

| Use Case | How Volatility Is Used |
|---|---|
| **Position sizing** | Scale position inversely with vol so each trade risks a consistent dollar amount |
| **Stop placement** | ATR-based stops widen in high-vol regimes, tighten in low-vol |
| **Strategy selection** | Mean-reversion works in low vol; momentum works in high vol |
| **Risk budgeting** | Vol-target portfolios maintain constant portfolio-level risk |
| **Regime detection** | Vol regime shifts signal changing market dynamics |
| **Option pricing** | Implied vs realized vol gap creates trading opportunities |

## Types of Volatility

### Historical (Realized) Volatility
Computed from observed past returns.  The most common and directly measurable
form.  Multiple estimators exist with different statistical efficiency.

### Implied Volatility
Derived from option prices via Black-Scholes or similar models.  Limited in
crypto DeFi where liquid options markets are sparse, but available on Deribit
for BTC/ETH.

### Forecast Volatility
Predicted future volatility from models like EWMA or GARCH.  Used for
forward-looking position sizing and risk budgets.

---

## Estimation Methods

### 1. Close-to-Close (Standard Deviation of Log Returns)

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

```python
import numpy as np

log_returns = np.log(closes[1:] / closes[:-1])
vol_daily = np.std(log_returns, ddof=1)
vol_annual = vol_daily * np.sqrt(365)  # crypto trades 365 days
```

- **Pros**: Simple, widely understood.
- **Cons**: Uses only close prices, ignores intraday range.

### 2. Parkinson (High-Low Range)

The rest: https://github.com/agiprolabs/claude-trading-skills/blob/HEAD/skills/volatility-modeling/SKILL.md
