Acceleration Indicator Documentation

Overview

The Acceleration indicator measures the rate of change in the velocity of price movements. It helps identify potential reversals, continuations, or changes in market momentum. A high acceleration indicates strong market momentum, while low or negative acceleration can signal slowing momentum or potential trend reversals.

Syntax

const period = 14;  // The lookback period for the acceleration calculation
const acceleration = new I.Acceleration([period]);

Parameters

  1. period (Integer):

Returns

The Acceleration object provides a series of values representing the acceleration of price movements for each data point. Initial values may be undefined if the data points are insufficient to calculate acceleration for the specified period.

Calculation

The Acceleration indicator is derived using the following steps:

  1. Velocity: Calculate the rate of price change over the given period.
  2. Acceleration: Compute the rate of change in velocity.

Example Usage

Basic Implementation

const period = 14; // Calculate acceleration over 14 periods
const acceleration = new I.Acceleration([period]);

console.log(acceleration); // Outputs an array of acceleration values

Detecting Market Momentum

Use acceleration to assess market momentum changes:

const iv = HFS.indicatorValues(state);
const accelValue = iv.accel; // Latest acceleration value

if (accelValue > 0) {
    console.log("Positive acceleration: Market momentum is increasing.");
} else if (accelValue < 0) {
    console.log("Negative acceleration: Market momentum is decreasing.");
} else {
    console.log("Neutral acceleration: No significant change in momentum.");
}

Integration in Strategies