Relative Velocity

The Relative Velocity rule calculates price velocity and acceleration metrics with relative scaling and normalisation. It measures the rate of price change over a specified lookback period and provides normalised values that adjust for market conditions, enabling meaningful comparisons of momentum across different instruments and varying volatility regimes.

How It Works

The Relative Velocity rule calculates velocity and acceleration metrics for price movements, with additional relative scaling that normalises values based on historical ranges. This normalisation is what sets it apart from the standard Velocity rule—it allows you to compare momentum across different instruments and market conditions on a consistent scale.

The rule calculates several key metrics:

  • Velocity: Measures the rate of price change over the specified lookback period, showing how fast price is moving.
  • Acceleration: Measures the rate of change of velocity, indicating whether momentum is increasing or decreasing.
  • Gradient: A simple slope calculation between the current value and a previous value from the lookback period.
  • Relative Velocity: Normalised velocity scaled relative to the maximum and minimum velocities within the lookback period, providing a consistent momentum measure regardless of the instrument’s price scale.
  • Relative Acceleration: Normalised acceleration scaled relative to the maximum and minimum accelerations within the lookback period.
  • Averages and Standard Deviations: Mean and standard deviation calculations for both relative velocity and relative acceleration over a secondary smoothing period (SD Length), indicating whether current momentum is statistically unusual.

The rule uses configurable moving averages for smoothing calculations, supporting multiple types: Simple (SMA), Exponential (EMA), Double Exponential (DEMA), Relative (RMA), Weighted (WMA), Hull (HMA), and Arnaud Legoux (ALMA). When using ALMA, additional parameters for shift and sigma allow fine-tuning of the Gaussian distribution characteristics.

The relative scaling approach makes this rule particularly valuable for comparing momentum across different instruments, identifying relative strength or weakness in trending versus consolidating markets, and creating consistent entry and exit signals that adapt to changing market dynamics.

Inputs

Parameter Description Required Default
Source The price or numeric value source that provides the data for velocity and acceleration calculations. This is typically the closing price of candles or bars, but can be any numeric output. Yes
Relative Range Length The number of historic values to use when calculating the relative velocity and relative acceleration metrics. This determines the lookback period for normalisation. Yes 1
SD Length The number of calculated values to use when computing the standard deviation and average of the relative velocity and relative acceleration metrics. Yes 13
Offset The offset of the number of values to process. An offset of 0 processes current values, while positive values reference calculations from previous periods. Yes 0
MA Type The moving average type used for smoothing calculations. Options include Simple (SMA), Exponential (EMA), Double Exponential (DEMA), Relative (RMA), Weighted (WMA), Hull (HMA), and Arnaud Legoux (ALMA). Yes
MA Length The number of values to use when calculating the smoothed moving average for velocity and acceleration calculations. Yes 1
Shift The shifted offset of the centre of the Gaussian distribution over lookback values, used for the Arnaud Legoux Moving Average (ALMA). Affects the responsiveness of the average. Only shown when MA Type is ALMA. When MA Type is ALMA 0.85
Sigma Determines the width of the Gaussian weighting, affecting how much emphasis is placed on the centre of the lookback range. Used for ALMA calculations. Only shown when MA Type is ALMA. When MA Type is ALMA 6.0

Outputs

Output Description
Velocity The velocity of the values based on the configuration, calculated using moving-average-smoothed values over the specified MA Length period.
Acceleration The acceleration of the values (rate of change of velocity), calculated using moving-average-smoothed values over the specified MA Length period.
Gradient The simple gradient calculated from the last value in the Relative Range Period to the current value, taking into account the specified Offset.
Relative Velocity Normalised velocity scaled relative to the maximum and minimum velocity within the Relative Range Period, providing a consistent momentum measure across different instruments.
Relative Velocity (Avg) The mean average of the relative velocity for all values calculated within the period determined by the SD Length, providing a smoothed relative momentum measure.
Relative Velocity (SD) The standard deviation of the relative velocity values over the SD Length period, indicating the variability and statistical significance of current momentum levels.
Relative Acceleration Normalised acceleration scaled relative to the maximum and minimum acceleration within the Relative Range Period.
Relative Acceleration (Avg) The mean average of the relative acceleration within the SD Length period, providing a smoothed measure of momentum change.
Relative Acceleration (SD) The standard deviation of the relative acceleration values over the SD Length period, indicating the variability of momentum change levels.

Tips

The Relative Velocity output is ideal for multi-instrument strategies because it normalises momentum to a consistent scale, allowing you to compare momentum between, say, EUR/USD and gold on equal footing. Use the standard deviation outputs to identify statistically significant momentum—when the relative velocity exceeds 2 standard deviations from the average, it often signals an unusually strong move. The Acceleration output is valuable for detecting momentum shifts early: when velocity is positive but acceleration is turning negative, it may indicate the trend is losing steam.

Was this helpful? Let us know