Skip to main content

Rolling Percentile Rank

Quick Reference

PropertyValue
Dimensionregime
Categorystatistics
Versionv1.0
Output Columnpercentile_rank

Percentile rank of current value within a rolling window 鈥?measures relative position

Formula

percentile_rank(price, window)

CDM Inputs

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

Parameters

ParameterTypeDefaultDescription
windowinteger3600000Window for percentile estimation

Output

Column: percentile_rank

Percentile rank of current value in rolling window (0 to 1)

Market Intuition & Trading Rationale

Rolling percentile rank maps the current value to its position in the recent distribution: percentile_rank(price, window). 0.95 means price is at the 95th percentile 鈥?higher than 95% of recent observations (overbought). 0.05 means price is at the 5th percentile (oversold). 0.50 means price is at its median. This is a robust, distribution-free normalization 鈥?no normality assumption needed.

Usage Cases

  • Overbought/oversold without assumptions: rank > 0.9 鈫?overbought (potential reversal down). rank < 0.1 鈫?oversold (potential reversal up). More robust than z-score for non-normal distributions.
  • Volatility regime transitions: Used in volatility_regime_transition pack 鈥?percentile_rank of volatility identifies when current vol is extreme relative to its own history.
  • Non-parametric normalization: Use percentile_rank to normalize any feature to [0, 1] without assuming a distribution. This is the preferred normalization for fat-tailed financial data.

YAML Definition

name: rolling_percentile_rank
description: Percentile rank of current value within a rolling window 鈥?measures relative
position
category: statistics
dimension: regime
version: v0.9.0 (Beta)
required_inputs:
- price
output_column: percentile_rank
output_description: Percentile rank of current value in rolling window (0 to 1)
tags:
- regime
- percentile
- statistics
parameters:
window:
type: integer
description: Window for percentile estimation
required: false
default: 3600000
formula: percentile_rank(price, window)