Skills

Volatility Modeling

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

Install

npx skills add agiprolabs/claude-trading-skills --skill volatility-modeling -g -a claude-code -y
Category
Engineering
Updated
2mo ago
License
MIT
Context cost
Mediumabout 2,026 tokens
Runs scripts
Yes, review before use

What it does

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

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 CaseHow Volatility Is Used
Position sizingScale position inversely with vol so each trade risks a consistent dollar amount
Stop placementATR-based stops widen in high-vol regimes, tighten in low-vol
Strategy selectionMean-reversion works in low vol; momentum works in high vol
Risk budgetingVol-target portfolios maintain constant portfolio-level risk
Regime detectionVol regime shifts signal changing market dynamics
Option pricingImplied 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.

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)

Read the whole SKILL.md on GitHub

More in Engineering