Skip to main content

Abs Price Distance

Quick Reference

PropertyValue
Dimensionsignal
Categorymomentum
Versionv1.0
Output Columnabs_price_distance

Absolute z-score distance of price from its moving average 鈥?proxy for distance to a reference level when actual level data is unavailable.

Formula

abs((price - rolling_mean(price, window)) / (rolling_std(price, window) + 1e-10))

CDM Inputs

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

Parameters

ParameterTypeDefaultDescription
windowinteger50Lookback window in ticks for the moving average baseline

Output

Column: abs_price_distance

Z-score of price deviation from moving average (absolute value)

Market Intuition & Trading Rationale

Abs Price Distance measures how far current price has deviated from its rolling mean in standard deviation units. The absolute value strips direction 鈥?capturing magnitude of displacement regardless of whether price is above or below the reference level. This makes it useful as a level-proximity proxy when explicit support/resistance levels are not pre-defined.

When abs_price_distance is low (near 0), price is trading close to its rolling mean 鈥?this can represent consolidation or the "retest" phase where price returns to a reference level. When abs_price_distance is high (2+), price is extended 鈥?either breaking out or overextended. The interaction with other momentum and flow features determines which interpretation holds.

In breakout contexts, abs_price_distance declining from a high signals a failed breakout returning to the reference level. Paired with retest_failure_strength (which captures whether price stays below the peak), it provides a complete picture of price behavior relative to local extremes 鈥?the distance to the mean and the failure to reclaim the peak.

Usage Cases

  • Breakout retest detection: When abs_price_distance drops below 0.5 after a prior spike above 2, price has returned to its rolling mean 鈥?defining the retest zone. Combined with retest_failure_strength staying negative (below peak), this confirms a failed breakout setup.
  • Level proximity proxy: Use abs_price_distance as a stand-in for distance-to-level in instruments where explicit S/R levels are dynamic or undefined. Low values indicate price near reference, high values indicate extension.
  • Volatility-adjusted extension: Unlike raw price distance, the z-score normalization adapts to changing volatility regimes. In high-vol periods, a given price move produces a smaller z-score, preventing false breakout signals. In low-vol periods, even modest moves generate meaningful z-scores.
  • feature set integration: In the breakout_failure pack, abs_price_distance gates the retest phase 鈥?only when price is near the mean (low distance) and failing to reclaim the peak does the pack generate a reversal signal.

YAML Definition

name: abs_price_distance
description: Absolute z-score distance of price from its moving average 鈥?proxy for
distance to a reference level when actual level data is unavailable.
category: momentum
dimension: signal
version: v0.9.0 (Beta)
required_inputs:
- price
output_column: abs_price_distance
output_description: Z-score of price deviation from moving average (absolute value)
tags:
- momentum
- signal
parameters:
window:
type: integer
description: Lookback window in ticks for the moving average baseline
required: false
default: 50
formula: abs((price - rolling_mean(price, window)) / (rolling_std(price, window) + 1e-10))