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).
const accumulationDistribution = new I.AccumulationDistribution();
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.
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.
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
const iv = HFS.indicatorValues(state);
const adValue = iv.accumulationDistribution;
console.log(adValue); // Outputs the most recent A/D value
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.");
}
Use the A/D indicator to confirm price trends or divergences: