Price Velocity
Quick Reference
| Property | Value |
|---|---|
| Dimension | signal |
| Category | momentum |
| Version | v1.0 |
| Output Column | price_velocity |
Price change over a fixed number of bars (bar-based momentum)
Formula
trade_price - lag(trade_price, window_bars)
CDM Inputs
| Column | CDM Table | Description |
|---|---|---|
trade_price | cdm_trade_enriched | Trade data enriched with bar context — price, volume, side, trade type |
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
window_bars | integer [1, 500] | 5 | Number of bars for price change calculation |
Output
Column: price_velocity
Price difference over the specified number of bars
Market Intuition & Trading Rationale
Price velocity measures raw price momentum as the difference between the current trade price and the price window_bars bars ago: trade_price - lag(trade_price, window_bars). Unlike return-based momentum which normalizes by the starting price, price velocity retains the price scale of the instrument — a velocity of $1.50 means price has moved $1.50 over the window, regardless of whether the instrument trades at $10 or $500.
This bar-based momentum measure is the simplest form of trend detection. Positive velocity means price is higher than it was window_bars bars ago; negative means lower. The magnitude indicates the strength of the move in absolute terms. Because it works in bar time (each bar is one observation) rather than clock time, it adapts naturally to irregular trading intervals — a 5-bar lookback always captures the last 5 observations regardless of whether they span 5 seconds or 5 minutes.
The window_bars parameter controls the momentum horizon. Short windows (1–5 bars) capture tick-to-tick momentum — the immediate price impact of the last few trades. These are high-frequency signals suitable for market making and latency-sensitive strategies. Medium windows (10–50 bars) capture short-term trends and breakout momentum. Longer windows (100–500 bars) capture intraday swing movements and are less affected by microstructure noise.
Price velocity is most effective when normalized by volatility. A $0.50 price move in a quiet stock (typical bar range of $0.10) is highly significant, while the same $0.50 move in a volatile stock (typical bar range of $2.00) is noise. Combining price velocity with realized volatility or the high-low range gives a volatility-adjusted momentum measure that is comparable across instruments.
Usage Cases
- Bar momentum signal: Positive price_velocity over the last 5 bars indicates short-term upward momentum. Enter long and trail the stop using a fixed offset from the entry price.
- Momentum divergence: price_velocity rising while price is flat or falling indicates latent buying pressure. Conversely, price_velocity falling while price is flat suggests distribution.
- Microstructure mean reversion: At very short windows (1–3 bars), price_velocity tends to mean-revert due to bid-ask bounce. A large positive velocity is often followed by a negative velocity as the next trade hits the bid side.
- Trend filter: Only take long signals when price_velocity(window_bars=50) is positive (uptrend context) and short signals when it is negative (downtrend context). This eliminates counter-trend entries.
YAML Definition
name: price_velocity
description: Price change over a fixed number of bars (bar-based momentum)
category: momentum
version: v0.9.0 (Beta)
dimension: signal
required_inputs:
- cdm_trade_enriched.trade_price
output_column: price_velocity
output_description: Price difference over the specified number of bars
tags:
- momentum
- velocity
- signal
- price
parameters:
window_bars:
type: integer
description: Number of bars for price change calculation
required: false
default: 5
constraints:
min: 1
max: 500
formula: trade_price - lag(trade_price, window_bars)