Acceleration
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
| Name | Type | Default | Description |
|---|---|---|---|
| period | number | 20 | Rolling window size. Minimum 3. |
Inputs & Outputs
| Port | Type | Description |
|---|---|---|
| Inputs | ||
| input | number[] | Source numeric array |
| Outputs | ||
| values | number | null | Computed value at each bar; null before the warmup period completes |
| timestamps | number[] | Bar timestamps (UNIX ms), aligned 1-to-1 with values |
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.