Agent skill

Volatility Modeling

by agiprolabs in agiprolabs/claude-trading-skills

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

MITAuto-check passedData & Analytics

Install Volatility Modeling

skills CLI
$ npx skills add agiprolabs/claude-trading-skills --skill volatility-modeling -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install agiprolabs/claude-trading-skills volatility-modeling --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/volatility-modeling .claude/skills/volatility-modeling && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
volatility-modeling
GitHub stars
410
Token cost
~2.1k tokens
SKILL.md length
773 words
Files
5 (incl. scripts, references)
Skills in repo
68
Repo updated
First seen
Licence
MIT

At a glance

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

  • Works in 6 steps: Close-to-Close (Standard Deviation of… → Parkinson (High-Low Range) → Garman-Klass (OHLC) → …
  • Tasks that involve Forecasting and time series
  • SKILL.md covers Why Volatility Matters, Types of Volatility, Estimation Methods and Volatility Cones, plus 6 more sections
  • Runs Python scripts from its folder; calls uv

What it does

Volatility Modeling is an agent skill from agiprolabs/claude-trading-skills. Volatility estimation, forecasting, and regime classification using GARCH, EWMA, realized volatility, and volatility cones

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including scripts and reference files (for example `references/estimators.md`, `references/volatility_cones.md` and `scripts/estimate_volatility.py`).

It sits in Data & Analytics, covering Forecasting and time series. The repository describes itself as: 68 trading, DeFi, and quantitative finance Agent Skills. Works with Claude Code, Cursor, Codex, Gemini CLI, and 30+ other tools. The licence is MIT.

When your agent uses it

  • Tasks that involve Forecasting and time series

Example prompts

  • “/volatility-modeling”

Requirements

  • Python 3

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Close-to-Close (Standard Deviation of Log Returns)
  2. Parkinson (High-Low Range)
  3. Garman-Klass (OHLC)
  4. Yang-Zhang
  5. EWMA (Exponentially Weighted Moving Average)
  6. GARCH(1,1)

What it can do on your machine

Read from SKILL.md and the folder at commit 981e1d7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 2 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • uv

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use uv, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Volatility Modeling loads about 2.1k tokens when it runs, and up to ~5.1k if it reads all its reference files. Until then it costs about 36 tokens; SKILL.md has 773 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~36
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from agiprolabs/claude-trading-skills at commit 981e1d7, republished under its MIT licence (© agiprolabs). 773 words, ~2,070 tokens.

Download SKILL.mdSave it as .claude/skills/volatility-modeling/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
volatility-modeling
description
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.

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)

Uses the daily high-low range, which is ~5x more statistically efficient than close-to-close.

python
hl_ratio = np.log(highs / lows)
vol_parkinson = np.sqrt(np.mean(hl_ratio**2) / (4 * np.log(2))) * np.sqrt(365)
  • Pros: More efficient, captures intraday moves.
  • Cons: Downward bias with discrete sampling; ignores close-to-close jumps.
3. Garman-Klass (OHLC)

The most efficient single-day OHLC estimator.

python
hl = np.log(highs / lows)
co = np.log(closes / opens)
gk = np.mean(0.5 * hl**2 - (2 * np.log(2) - 1) * co**2)
vol_gk = np.sqrt(gk) * np.sqrt(365)
  • Pros: Best efficiency among OHLC estimators.
  • Cons: Assumes no drift; sensitive to opening gaps.
4. Yang-Zhang

Combines overnight (close-to-open) and open-to-close components. Handles gaps properly. Less relevant for 24/7 crypto but useful for tokens with sporadic trading.

5. EWMA (Exponentially Weighted Moving Average)

RiskMetrics approach — no parameters to estimate beyond λ.

python
lam = 0.94  # RiskMetrics default for daily
ewma_var = np.zeros(len(returns))
ewma_var[0] = returns[0] ** 2
for t in range(1, len(returns)):
    ewma_var[t] = lam * ewma_var[t - 1] + (1 - lam) * returns[t - 1] ** 2
vol_ewma = np.sqrt(ewma_var) * np.sqrt(365)
  • λ = 0.94 for daily data (RiskMetrics).
  • λ = 0.97 for weekly data.
  • Higher λ → smoother, slower reaction to new information.
6. GARCH(1,1)

The workhorse autoregressive volatility model. Captures volatility clustering.

σ²_t = ω + α · r²_{t-1} + β · σ²_{t-1}
  • ω: long-run variance weight.
  • α: reaction to recent shock (typically 0.05–0.15 for crypto).
  • β: persistence (typically 0.80–0.90 for crypto).
  • α + β < 1: stationarity constraint.
  • Long-run variance: ω / (1 − α − β).

Estimated via maximum likelihood. See references/estimators.md for details.


Volatility Cones

Volatility cones show the percentile distribution of realized volatility at different lookback windows, revealing whether current vol is historically high or low.

Construction
  1. Get 1+ years of daily data.
  2. For each lookback window (5, 10, 20, 60, 120 days):
    • Compute rolling realized volatility.
    • Extract percentiles: 5th, 25th, 50th, 75th, 95th.
  3. Plot percentiles vs window length — the "cone" shape.
  4. Overlay current realized vol at each window.
Show full SKILL.md (324 more words)Show less
Interpretation
  • Current vol > 75th percentile: historically elevated — expect mean reversion.
  • Current vol < 25th percentile: historically compressed — expect expansion.
  • Cone narrowing at longer windows: vol mean-reverts over longer horizons.

See references/volatility_cones.md for full methodology and worked examples.


Crypto Volatility Characteristics

Crypto vol differs from traditional assets in important ways:

CharacteristicDetail
Level50–150% annualized is typical; TradFi equities are 15–25%
ClusteringStrong — high-vol days cluster together
Weekday patternsWeekend vol often lower but weekend gaps can be large
Volume correlationVol and volume are positively correlated
Regime dependenceBull market vol ≠ bear market vol; ranges are different
Mean reversionVol mean-reverts more reliably than price
Tail riskFat tails — more extreme moves than normal distribution predicts
Regime Classification by Volatility
RegimeAnnualized Vol RangeCharacteristics
Low vol< 40%Range-bound, mean reversion works
Normal vol40–80%Trending possible, balanced strategies
High vol80–120%Strong trends or sharp reversals
Crisis vol> 120%Liquidation cascades, reduced position size

Volatility Forecasting

EWMA Forecast

Simple and effective. The current EWMA variance estimate is the 1-step forecast. Multi-step forecasts are flat (same as 1-step).

GARCH Forecast

GARCH produces a term structure of variance forecasts:

σ²_{t+h} = V_L + (α + β)^h · (σ²_t − V_L)

Where V_L = ω / (1 − α − β) is the long-run variance.

  • Short-horizon forecasts reflect current conditions.
  • Long-horizon forecasts converge to long-run variance.
  • The speed of convergence depends on α + β (persistence).

See scripts/vol_forecast.py for a working implementation.


Practical Applications

Position Sizing with Volatility
python
# Vol-target position sizing
target_vol = 0.02  # 2% daily portfolio vol target
current_vol = 0.05  # 5% daily asset vol (annualized ~95%)
weight = target_vol / current_vol  # = 0.40 → 40% allocation

See the position-sizing skill for complete integration.

ATR-Based Stop Placement
python
atr_14 = talib.ATR(highs, lows, closes, timeperiod=14)
stop_distance = 2.0 * atr_14[-1]  # 2x ATR stop
stop_price = entry_price - stop_distance  # for longs
Vol-Regime Strategy Selection
python
vol_percentile = current_vol_percentile(token, window=30)
if vol_percentile < 25:
    strategy = "mean_reversion"
elif vol_percentile > 75:
    strategy = "momentum_breakout"
else:
    strategy = "balanced"

Files

References
FileDescription
references/estimators.mdFull derivations and details for all volatility estimators
references/volatility_cones.mdCone construction methodology and interpretation guide
Scripts
FileDescription
scripts/estimate_volatility.pyMulti-estimator volatility computation with cone analysis
scripts/vol_forecast.pyEWMA and GARCH forecasting with term structure output

  • regime-detection — Classify market regimes using volatility as a key input.
  • position-sizing — Scale positions inversely with volatility.
  • risk-management — Portfolio-level vol targeting and risk budgets.
  • pandas-ta — ATR and Bollinger Bands are volatility-based indicators.
  • custom-indicators — Build crypto-specific volatility indicators.

Dependencies

bash
uv pip install pandas numpy scipy

Optional for live data:

bash
uv pip install httpx

© agiprolabs, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (scripts, references) in skills/volatility-modeling of agiprolabs/claude-trading-skills.

  • SKILL.md
  • references/estimators.md
  • references/volatility_cones.md
  • scripts/estimate_volatility.py
  • scripts/vol_forecast.py

Open the folder on GitHubat commit 981e1d7

Compare with similar skills

Volatility Modeling next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Volatility Modeling compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Volatility Modeling this skillagiprolabs/claude-trading-skills410—~2.1kAutomated safety check: PassMIT
TimesFM Forecastinggoogle-research/timesfm34k—~4.7kAutomated safety check: PassApache-2.0
Timesfm ForecastingzLanqing/codex-claude-academic-skills4.6k6 repos~7.5kAutomated safety check: NotesApache-2.0
StatsmodelszLanqing/codex-claude-academic-skills4.6k16 repos~4.9kAutomated safety check: PassBSD-3-Clause
Alphaear Predictorninehills/skills2812 repos~531Automated safety check: PassNone
Find Hypertable Candidatestimescale/pg-aiguide1.9k1 repos~2.6kAutomated safety check: PassApache-2.0

Similar skills

  • TimesFM Forecasting

    google-research/timesfm

    Forecasts any univariate time series zero-shot with Google's TimesFM model, returning point forecasts and calibrated prediction intervals without training.

    34k GitHub stars~4.7k tokensUpdated 9 days ago
    Data & AnalyticsAuto-check passed
  • Timesfm Forecasting

    zLanqing/codex-claude-academic-skills

    Zero-shot time series forecasting with Google's TimesFM foundation model.

    4.6k GitHub starsUsed in 6 repos~7.5k tokens
    Data & AnalyticsAuto-check: notes
  • Statsmodels

    zLanqing/codex-claude-academic-skills

    Statistical models library for Python. An agent skill from zLanqing/codex-claude-academic-skills.

    4.6k GitHub starsUsed in 16 repos~4.9k tokens
    Data & AnalyticsAuto-check passed
  • Alphaear Predictor

    ninehills/skills

    Market prediction skill using Kronos. An agent skill from ninehills/skills.

    281 GitHub starsUsed in 2 repos~531 tokens
    Data & AnalyticsAuto-check passed
  • Find Hypertable Candidates

    timescale/pg-aiguide

    A skill your agent uses to analyze an existing PostgreSQL database and identify which tables should be converted to Timescale/TimescaleDB hypertables.

    1.9k GitHub starsUsed in 1 repo~2.6k tokens
    Data & AnalyticsAuto-check passed
  • Pensieve Search

    arkohut/pensieve

    Search the user's local Pensieve screenshot archive by text, app, or time range.

    1.4k GitHub stars~8.2k tokensUpdated 2 mo ago
    Data & AnalyticsAuto-check passed

More from agiprolabs/claude-trading-skills

All 68 skills in this repo
  • Backtrader

    agiprolabs/claude-trading-skills

    Event-driven backtesting with bar-by-bar execution, complex order types, multiple analyzers, and custom indicators

    410 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Birdeye API

    agiprolabs/claude-trading-skills

    Solana token market data via Birdeye — prices, OHLCV, trades, token metadata, security checks, and trader activity

    410 GitHub stars~1.8k tokensUpdated 1 mo ago
    Auto-check passed
  • Coingecko API

    agiprolabs/claude-trading-skills

    Broad crypto market data from CoinGecko covering 13,000+ tokens.

    410 GitHub stars~1.6k tokensUpdated 1 mo ago
    Auto-check passed
  • Cointegration Analysis

    agiprolabs/claude-trading-skills

    Cointegration testing for pairs trading using Engle-Granger, Johansen, and rolling stability analysis

    410 GitHub stars~2.1k tokensUpdated 1 mo ago
    Auto-check passed
  • Copy Trading

    agiprolabs/claude-trading-skills

    Wallet evaluation, monitoring, and copy-trade strategy design for Solana DEX trading

    410 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Correlation Analysis

    agiprolabs/claude-trading-skills

    Cross-asset correlation analysis including rolling correlation, hierarchical clustering, tail dependence, and regime-dependent correlation

    410 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed

Questions about Volatility Modeling

What does Volatility Modeling do?

Volatility estimation, forecasting, and regime classification using GARCH, EWMA, realized volatility, and volatility cones. Volatility Modeling is an agent skill from agiprolabs/claude-trading-skills.

When should I use Volatility Modeling?

Volatility Modeling fits situations like: tasks that involve Forecasting and time series.

How do I install Volatility Modeling in Claude Code?

Run `npx skills add agiprolabs/claude-trading-skills --skill volatility-modeling -a claude-code`. Or copy the skill folder (skills/volatility-modeling in agiprolabs/claude-trading-skills) into .claude/skills/volatility-modeling in your project. Claude Code loads it when a task matches its description.

How do I install Volatility Modeling in Codex?

Run `npx skills add agiprolabs/claude-trading-skills --skill volatility-modeling -a codex`. Or copy the skill folder (skills/volatility-modeling in agiprolabs/claude-trading-skills) into .agents/skills/volatility-modeling in your project. Codex loads it when a task matches its description.

Can I use Volatility Modeling in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add agiprolabs/claude-trading-skills --skill volatility-modeling -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/volatility-modeling, .gemini/skills/volatility-modeling, .github/skills/volatility-modeling and .opencode/skills/volatility-modeling in your project.

What does Volatility Modeling need to run?

Going by SKILL.md and its folder, Volatility Modeling needs Python for the scripts in its folder and the command-line tools its instructions call (uv). Our summary lists: Python 3.

Does Volatility Modeling access the network?

SKILL.md contains no URLs. Its commands use uv, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Volatility Modeling safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Volatility Modeling use?

Volatility Modeling is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Volatility Modeling use?

About 2.1k tokens (SKILL.md is roughly 8.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3k tokens, read only when the agent opens those files.

What are the alternatives to Volatility Modeling?

Skills that share tags, products or a category with Volatility Modeling: TimesFM Forecasting (google-research/timesfm, 34k stars), Timesfm Forecasting (zLanqing/codex-claude-academic-skills, 4.6k stars), Statsmodels (zLanqing/codex-claude-academic-skills, 4.6k stars) and Alphaear Predictor (ninehills/skills, 281 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Volatility Modeling?

agiprolabs (a GitHub user) maintains it in agiprolabs/claude-trading-skills, which has 410 GitHub stars. The repository holds 68 skills in this directory. The repository was last updated on September 3, 2026.

Source: agiprolabs/claude-trading-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.