skillfed

volatility

This strategy captures volatility mean reversion by computing annualized historical volatility and ranking it percentile-wise over a lookback period. Long signals trigger when volatility sits in the low percentile range, positioning for expansion; short or exit signals fire when volatility ranks high, betting on contraction. Works with any OHLCV data across equities and crypto.

Volatility trades mean reversion by ranking historical volatility percentiles to signal long entries in low-volatility regimes and exits in high-volatility regimes.

AI-generated summary based on this skill's SKILL.md

28,096 4,557 MIT updated by HKUDS

Install

HKUDS/Vibe-Trading/volatility · repository language: Python

CLI (skillfed)coming soon
git clone https://github.com/HKUDS/Vibe-Trading
cp -r Vibe-Trading/agent/src/skills/volatility ~/.claude/skills/volatility

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

What is volatility mean reversion strategy and how does it work?

volatility uses a mean reversion approach by computing annualized historical volatility and ranking it percentile-wise over a lookback period. When volatility sits in the low percentile range, long signals trigger to position for expansion; when volatility ranks high, short or exit signals fire to bet on contraction. This captures the tendency for extreme volatility to revert toward average levels.

How does volatility identify low and high volatility regimes?

volatility ranks current historical volatility against its percentile distribution over the lookback window. Low percentile readings indicate a low volatility regime suitable for long entry, while high percentile readings signal a high volatility regime for short positioning or exits. This percentile-based ranking automatically adapts to market conditions without fixed thresholds.

Can volatility generate trading signals from volatility expansion and contraction?

Yes. volatility generates signals by monitoring volatility expansion and contraction patterns. Long signals emerge when volatility expands from low percentile levels, capturing upside moves as markets become more active. Short or exit signals trigger when volatility contracts from high percentile levels, betting on mean reversion back to calmer conditions.

What data does volatility require and which markets does it support?

volatility works with any OHLCV (open, high, low, close, volume) data. It supports both equities and crypto markets, making it flexible across asset classes. The strategy computes annualized historical volatility from price bars, so any market with reliable OHLCV feeds can be backtested or traded live.

How can I backtest volatility-based strategy on historical OHLCV data?

volatility backtests by applying its percentile-ranked historical volatility logic to OHLCV bars over your chosen period. The strategy computes annualized volatility for each bar, ranks it against the lookback window, and generates entry/exit signals based on percentile thresholds. Results show how mean reversion signals would have performed on past data.

Does volatility capture volatility regime shifts across different markets?

volatility is designed to detect and adapt to volatility regime shifts across crypto and equity markets. By continuously ranking historical volatility percentile-wise, it responds to transitions between calm and turbulent market conditions. This regime-aware approach helps traders adjust positioning when volatility dynamics fundamentally change.

SKILL.md

rendered from the published skill — quoted content, verbatim

Volatility Strategy

Purpose

Uses percentile ranking of historical volatility (HV) to capture volatility mean reversion: build positions in low-volatility regimes while waiting for volatility expansion, and exit or short in high-volatility regimes to capture contraction.

Signal Logic

  1. Compute HV: annualized standard deviation of returns over the past hv_window days
  2. Percentile ranking: percentile position of HV within the past lookback days (0-100)
  3. Signal generation:
  4. Percentile < low_pct → go long (volatility is low, waiting for expansion)
  5. Percentile > high_pct → exit / go short (volatility is high, waiting for contraction)
  6. Middle region → keep the current position

Key Implementation Details

  • HV = returns.rolling(hv_window).std() * sqrt(252) (annualized)
  • Percentile = hv.rolling(lookback).rank(pct=True) * 100
  • For cryptocurrencies, use 365 instead of 252 as the annualization factor

Parameters

| Parameter | Default | Description

(truncated - see the full file via the links below)

Read as markdown · JSON record · Browse the source repository

File tree — 2 files
agent/src/skills/volatility/SKILL.md
agent/src/skills/volatility/example_signal_engine.py

Related skills

Tags

mean-reversion volatility-regimes percentile-ranking expansion-contraction statistical-trading regime-detection volatility-cycles signal-generation risk-adjusted ohlcv-compatible