volatility

Installation
SKILL.md

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:
    • Percentile < low_pct → go long (volatility is low, waiting for expansion)
    • Percentile > high_pct → exit / go short (volatility is high, waiting for contraction)
    • 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
Installs
3
GitHub Stars
31.3K
First Seen
Jun 15, 2026
volatility — hkuds/vibe-trading