Skip to main content

Realized Volatility Percentile

Quick Reference

PropertyValue
Dimensionsignal
Categoryvolatility
Versionv1.0
Output Columnvol_compression

Volatility compression: ratio of short-term to long-term realized vol. Values below 1 indicate compression (pre-breakout), above 1 indicate expansion.

Formula

rolling_std(log_return, short_window) / (rolling_std(log_return, long_window) + 1e-10)

CDM Inputs

ColumnCDM TableDescription
log_returncdm_trade_enrichedEnriched trade data 鈥?log return of trade price

Parameters

ParameterTypeDefaultDescription
short_windowinteger [5, 500]20Short-term volatility window in bars
long_windowinteger [20, 5000]300Long-term volatility window in bars

Output

Column: vol_compression

Ratio of short-term vol to long-term vol (rolling_std)

Market Intuition & Trading Rationale

Realized Volatility Percentile measures the ratio of short-term to long-term realized volatility 鈥?effectively a compression/expansion oscillator. When short-term vol is low relative to long-term vol (ratio below 1), the market is in a compression phase: price movements have contracted, uncertainty is priced out, and the market is coiling. When short-term vol exceeds long-term vol (ratio above 1), the market is in an expansion phase: price movements are accelerating, uncertainty is rising, and a regime shift may be underway.

The compression-to-expansion transition is one of the most reliable breakout precursors in microstructure. Low vol_compression (e.g., < 0.5) indicates the market is unusually quiet 鈥?liquidity providers are comfortable, spreads are typically tight, and directional conviction is absent. This state is inherently unstable: mean-reversion strategies converge, passive volume accumulates, and the market becomes spring-loaded. When vol_compression then crosses above 1, the spring releases 鈥?the breakout or breakdown event begins.

The ratio-based construction has two important properties. First, it is self-normalizing: the same threshold (1.0) is meaningful across different instruments and volatility regimes because it compares the instrument to its own recent history. Second, the long_window parameter controls the reference baseline 鈥?a 300-bar long window captures the prevailing volatility regime, while the 20-bar short window captures the immediate state. The gap between them determines sensitivity: wider gaps detect larger compression-expansion cycles; narrower gaps capture shorter-term fluctuations.

Usage Cases

  • Pre-breakout positioning: In the microstructure_breakout feature set, volatility_compression_score values below 0.3 signal that the market is in a compressed, spring-loaded state. Combined with breakout strength and volume spike confirmation, this identifies high-probability breakout entries where the compression-to-expansion transition is underway.
  • Volatility regime transition detection: When vol_compression crosses above 1 after an extended period below 0.5, a volatility regime shift is occurring. This is useful both for breakout entries (entering as vol expands) and for risk management (reducing position sizes in expanding volatility environments).
  • Mean reversion timing: Extremely low vol_compression (below 0.3) favors mean reversion strategies 鈥?mean reversion works best in low-volatility, range-bound conditions. Rising vol_compression above 1.5 favors momentum and breakout strategies. The ratio provides a continuous signal for dynamic strategy allocation.
  • False breakout filter: A breakout signal with vol_compression still below 0.7 (no expansion) is more likely to be a false breakout or noise-driven level touch. Genuine breakouts are volatility events 鈥?the expansion must be present. Require vol_compression above 1.0 as a confirming condition for breakout entries.
  • Execution scheduling: In vol compression phases, execution is cheaper (tighter spreads, lower impact). Schedule large orders or rebalancing during compression periods. In expansion phases, switch to more aggressive execution or defer trading.

YAML Definition

name: realized_volatility_percentile
description: 'Volatility compression: ratio of short-term to long-term realized vol. Values below 1 indicate compression (pre-breakout), above 1 indicate expansion.'
category: volatility
version: v0.9.0 (Beta)
dimension: signal
status: active
required_inputs:
- cdm_trade_enriched.log_return
output_column: vol_compression
output_description: Ratio of short-term vol to long-term vol (rolling_std)
parameters:
short_window:
type: integer
description: Short-term volatility window (bars)
required: false
default: 20
constraints:
min: 5
max: 500
long_window:
type: integer
description: Long-term volatility window (bars)
required: false
default: 300
constraints:
min: 20
max: 5000
formula: "rolling_std(log_return, short_window) / (rolling_std(log_return, long_window) + 1e-10)"