Skip to main content

Realized Volatility

Quick Reference

PropertyValue
Dimensionsignal
Categoryvolatility
Versionv0.9.0 (Beta)
Output Columnrealized_vol

Realized volatility: rolling_std(log_return, window) - observed dispersion of returns over a fixed horizon

Formula

rolling_std(log_return, window)

CDM Inputs

ColumnCDM TableDescription
log_returncdm_trade_enrichedTrade data enriched with bar context 鈥?price, volume, side, trade type

Parameters

ParameterTypeDefaultDescription
windowinteger [2, 10000]20Window size for rolling standard deviation

Output

Column: realized_vol

Rolling standard deviation of log returns

Market Intuition & Trading Rationale

Realized volatility measures observed price dispersion: rolling_std(log_return, window). It is the workhorse volatility estimator 鈥?model-free, always available, and directly interpretable as the standard deviation of returns over the lookback window. Unlike implied volatility (which embeds market expectations) or range-based estimators (which require OHLC data), realized volatility uses only the stream of log returns and can be computed on any data frequency.

The window parameter determines the volatility timescale. Short windows (5鈥?0 periods) capture microstructural noise and rapid regime changes 鈥?useful for execution algorithms that need to react quickly. Long windows (100鈥?000 periods) capture the broad volatility regime 鈥?useful for position sizing and risk management. The realized_volatility_spectrum feature set computes realized volatility at four different windows simultaneously to profile the full volatility term structure.

Realized volatility exhibits well-known stylized facts: it clusters (high vol follows high vol), mean-reverts slowly, correlates negatively with returns (the leverage effect), and exhibits intraday seasonality (U-shaped pattern, elevated at open/close). These patterns make realized volatility both a direct trading signal and a crucial normalization factor for other features.

Usage Cases

  • Position sizing: Scale position size inversely with realized_volatility. position = target_risk / realized_vol. This volatility-targeting approach stabilizes P&L volatility across regimes and instruments.
  • Volatility regime classification: Classify into low/normal/high vol regimes based on realized_vol percentile within a longer rolling window. Each regime calls for different strategies: low vol favors mean reversion, high vol favors momentum and breakout.
  • Signal normalization: Divide directional signals by realized_volatility to produce scale-free, comparable signals. volatility_adjusted_momentum does this explicitly 鈥?return_momentum / realized_vol.
  • Breakout detection: A sudden spike in realized_vol (short window vol exceeding long window vol by a threshold) signals a potential breakout or regime change. This is the core mechanism in jump_microstructure_noise and volatility_regime_transition packs.

YAML Definition

name: realized_volatility
description: 'Realized volatility: rolling_std(log_return, window) - observed dispersion
of returns over a fixed horizon'
category: volatility
version: v0.9.0 (Beta)
dimension: signal
status: Pre-release
required_inputs:
- log_return
output_column: realized_vol
output_description: Rolling standard deviation of log returns
parameters:
window:
type: integer
description: Window size for rolling standard deviation
required: false
default: 20
constraints:
min: 2
max: 10000
formula: rolling_std(log_return, window)