DocsMathStatisticsAcceleration

Acceleration

Windowed · default period 20Statistics

The Acceleration node measures the rate of change of momentum — the 2nd derivative of price. It computes first differences within the window (d[i] = v[i] − v[i−1]), then fits an OLS slope to those differences. A positive result means momentum is growing (accelerating up); negative means momentum is decelerating or reversing. At least 3 non-null values are required; output is null otherwise.

Algorithm

  • Compute first-differences: d[i] = v[i] − v[i−1] for non-null consecutive pairs within window
  • Apply OLS slope over the d[] array (x = index, y = d value)
  • result = slope of first-differences → 2nd derivative of the original series
  • Requires ≥ 3 non-null values; returns null otherwise

Parameters

NameTypeDefaultDescription
periodnumber20Rolling window size. Minimum 3.

Inputs & Outputs

PortTypeDescription
Inputs
inputnumber[]Source numeric array
Outputs
valuesnumber | nullComputed value at each bar; null before the warmup period completes
timestampsnumber[]Bar timestamps (UNIX ms), aligned 1-to-1 with values
Live mode: In live streaming mode the node updates only the last bar in-place rather than recalculating the full array, keeping CPU usage minimal during real-time data feeds.

Use Cases

Momentum Phase Detection

Use positive acceleration as an early signal that a trend is gaining strength before the momentum indicator itself peaks — an entry filter for trend-following strategies.

Divergence Analysis

Compare price acceleration vs. volume acceleration. Divergence (price accelerating while volume decelerates) warns of trend exhaustion.

Oscillator Curvature

Apply Acceleration to an RSI or MACD series to detect when the oscillator's rate of change is shifting — useful for spotting inflection points before crossovers occur.