Overview

The Accumulation/Distribution (A/D) indicator is a volume-based indicator designed to measure the cumulative flow of money into or out of a security. It combines price and volume data to assess whether a stock is being accumulated (bought) or distributed (sold).

Syntax

const accumulationDistribution = new I.AccumulationDistribution();

Parameters

The Accumulation/Distribution indicator does not require specific input parameters such as periods. It is calculated using price and volume data for each time period.

Returns

The AccumulationDistribution object provides a series of values representing the cumulative accumulation/distribution line, which increases or decreases based on the flow of money into or out of the security.

Accessing Indicator Values

To access the current values of the Accumulation/Distribution indicator:

const iv = HFS.indicatorValues(state);
const adValue = iv.accumulationDistribution; // Retrieve the most recent A/D value

Example Usage

Basic Implementation


const iv = HFS.indicatorValues(state);
const adValue = iv.accumulationDistribution;

console.log(adValue); // Outputs the most recent A/D value

Detecting Buying or Selling Pressure

Analyze the A/D value to gauge market sentiment:

if (adValue > 0) {
    console.log("Accumulation phase: Buying pressure is dominating.");
} else if (adValue < 0) {
    console.log("Distribution phase: Selling pressure is dominating.");
} else {
    console.log("Neutral: No significant accumulation or distribution.");
}

Integration in Strategies

Use the A/D indicator to confirm price trends or divergences: