The AccumDistr function in ProBuilder language is used to calculate the Accumulation/Distribution (A/D) indicator, which is a volume-based technical analysis tool designed to reflect cumulative inflows and outflows of money for a security. It helps in identifying divergences which can indicate potential reversals in the market trend.
Definition and Purpose:
The Accumulation/Distribution indicator is calculated by taking into account the volume, the range between the high and low prices, and the position of the close price within that range. The indicator aims to confirm the current trend of a stock by moving in the same direction. A divergence between the price trend and the A/D line suggests a possible reversal.
AccumDistr(price)
Where price can be any price series such as close, open, high, or low.
The A/D line is calculated using the formula:
myAD = sum[volume * ((Close - Low) - (High - Close)) / (High - Low)]
This formula computes the flow of volume in relation to the price movement between the high, low, and close values within a trading period.
To calculate the Accumulation/Distribution of the last 30 bars based on the Open price, you can use the following code:
ind1 = AccumDistr(Open)[30]
RETURN ind1
This example demonstrates how to access the A/D value from 30 bars ago using the Open price as the input for the AccumDistr function.