Indicators/probuilder · probacktest · proorder · proscreener

AccumDistr

AccumDistr in ProBuilder returns the Accumulation/Distribution line, a cumulative volume indicator that tracks money flow into or out of an instrument.

Syntax

probuilder
AccumDistr(price)

Parameters

NameTypeDefaultDescription
priceprice sourcecloseThe price series fed into the calculation. Common choices are close, open, high, or low.

Formula

code
CLV = ((Close - Low) - (High - Close)) / (High - Low)
AD  = cumulative sum of (Volume * CLV)

CLV is the close location value. It equals +1 when the bar closes at its high, -1 when it closes at its low, and 0 when it closes exactly in the middle of the range. Multiplying by volume converts that position into a money-flow estimate, and the cumulative sum turns per-bar flows into a single line.

How it works

On each bar, ProBuilder checks where the close sits inside the bar's high-low range. A close near the high means buyers controlled the session, so a large share of that bar's volume is added to the running total. A close near the low means sellers dominated, so volume is subtracted. Bars that close mid-range contribute little either way.

Because the line is cumulative, its absolute value carries no meaning. Only the direction and slope matter, and how they compare with price. When price makes a new high but the Accumulation/Distribution line does not, volume is failing to confirm the move, a condition often read as a warning of a possible reversal. The same logic applies in mirror image at new lows.

The indicator requires volume data. On instruments where the data feed provides no volume, the line stays flat and is not usable.

Examples

Example 1, Reading a past value of the A/D line (Indicator)

probuilder
// A/D line based on the open price, value from 30 bars ago
ind1 = AccumDistr(Open)[30]
RETURN ind1

The bracket suffix after the function call shifts the reading back in time. This example returns the Accumulation/Distribution value as it stood 30 bars earlier, useful when comparing current flow against a historical anchor.

Example 2, Volume-confirmed trend entry (ProOrder)

probuilder
// Enter long only when price and money flow rise together
ad     = AccumDistr(close)
adUp   = ad > Average[50](ad)
trend  = close > Average[100](close)

IF NOT LongOnMarket AND trend AND adUp THEN
  BUY 1 CONTRACT AT MARKET
ENDIF

IF LongOnMarket AND ad < Average[50](ad) THEN
  SELL AT MARKET
ENDIF

The A/D line above its own 50-bar average confirms that volume supports the price uptrend. The position closes when money flow drops back below its average.

Example 3, Screening for sustained accumulation (ProScreener)

probuilder
// Instruments whose A/D line has risen over the last 20 bars
ad = AccumDistr(close)
change = ad - ad[20]
SCREENER[change > 0](change AS "AD 20-bar change")

Returns instruments where the Accumulation/Distribution line is higher than 20 bars ago, a simple filter for steady buying pressure.

Interpretation

ObservationReading
Line rising with priceVolume confirms the uptrend.
Line falling with priceVolume confirms the downtrend.
Price makes new high, line does notBearish divergence, buying pressure is fading.
Price makes new low, line does notBullish divergence, selling pressure is fading.

Divergence signals identify conditions, not timing. The line can diverge from price for extended periods before any reversal occurs, so most workflows pair it with a trend filter or a separate entry trigger.

Common errors and gotchas

  • Absolute level is meaningless. The line is a cumulative sum, so comparing its value to a fixed threshold, or across instruments, produces nonsense. Compare slope and direction only.
  • No volume, no signal. On CFDs, forex pairs, or indices where the feed supplies no traded volume, the line is flat or based on tick volume. Verify what the data provider actually delivers before trusting the output.
  • Gaps are ignored. The close location value only looks inside the current bar's range. An instrument that gaps down heavily but closes near its intraday high still registers as accumulation, which can misrepresent the session.
  • Division by zero on flat bars. When high equals low, the CLV denominator is zero. ProBuilder handles the degenerate bar internally, but custom re-implementations of the formula need an explicit guard.
  • OBV, on-balance volume, a simpler cumulative volume line using whole-bar direction.
  • MoneyFlow, bounded money-flow measure between -1 and 1.
  • MoneyFlowIndex, volume-weighted oscillator bounded 0 to 100.
  • ChaikinOsc, momentum of the Accumulation/Distribution line via two EMAs.
  • WilliamsAccumDistr, Williams' variant of accumulation/distribution.
  • PVT, price-volume trend, cumulative volume scaled by percentage change.
  • ForceIndex, price change multiplied by volume.
  • Volume, raw per-bar volume used inside the calculation.