TradingView indicators

Accumulation distribution indicator on TradingView

The accumulation distribution indicator (ADL or A/D) adds volume weighted by each bar's closing position within its range. A close near the high adds volume; a close near the low subtracts it. ADL can disagree with price after a gap because it does not compare the close with the previous bar.

Read the calculation and counterexamples before using a divergence as a trade condition. ADL does not reveal the identity or intentions of buyers and sellers.

How the close-location weight becomes an ADL value

Multiplier = ((Close - Low) - (High - Close)) / (High - Low)

Bar contribution = Multiplier × Volume

ADL = Previous ADL + Bar contribution

On a bar with a nonzero range, the multiplier is +1 at the high, zero at the midpoint and -1 at the low. TradingView describes the line as a running total of these contributions in its ADL calculation guide. The calculation uses the close directly, not the typical price (high + low + close) / 3.

Illustrative calculation: high 110, low 100, close 108 and volume 1,000 give a multiplier of 0.6 and a contribution of +600. If the prior ADL was 2,000, the new value is 2,600. Those are weighted volume units, not dollars invested.

The absolute total depends on the bars included in the sum. Adding earlier history can shift the level without changing the contribution of the latest bar. Compare the line's change between specified bars on the same feed, not absolute totals across symbols. If high equals low, the written fraction divides by zero; a custom implementation needs an explicit zero-range rule rather than evaluating it unchanged.

ADL vs OBV: a gap can reverse the interpretation

ADL weights volume by the close's location in the current range. OBV adds the full volume when the close exceeds the previous close, subtracts it when lower, and stays unchanged on an equal close. Neither formula measures executed buy volume minus sell volume.

Independent hypothetical bars; volume is 1,000 unless stated otherwise.
BarPrevious close; high / low / closeADL changeOBV change
Gap down, close near high110; 104 / 100 / 103+500-1,000
Gap up, close near low100; 110 / 106 / 107-500+1,000
Same close, upper half of range103; 104 / 100 / 103+5000
Zero reported volume110; 104 / 100 / 103; volume 000

The first row is not evidence that falling price must reverse. Its positive ADL increment describes a close in the upper part of a lower price range. The overnight price drop has no separate term in the calculation. The zero-volume row shows a different limitation: neither line can express pressure without a volume contribution.

Check whether the selected feed supplies traded volume, tick counts or no volume. Keep exchange, session and timeframe fixed during comparisons. Missing volume is not zero volume, and a small reported volume produces a small contribution even when the multiplier is near +1 or -1.

For the close-to-close method and its own confirmation rules, see the OBV indicator guide.

Define divergence at the bars where it becomes knowable

A reproducible bullish rule compares two confirmed price lows: the second price low is lower, while ADL sampled on those same two bars is higher. A bearish rule compares a higher price high with a lower sampled ADL value. This pairing rule differs from matching independently detected ADL pivots; choose one before inspecting results.

  1. Choose the number of bars on each side of a price pivot and a permitted distance between consecutive pivots.
  2. Sample ADL at the price pivot bar. Compare it with ADL at the previous same-type price pivot.
  3. Wait for the right-side bars to close, then plot the event on that confirmation bar. Keep the original pivot time separately.
  4. If testing entries, define a later price trigger, invalidation and exit. Count signals that never trigger as well as completed trades.

Hypothetical example: lows at bars 20 and 30 are 100 and 98, with ADL values of 5,000 and 5,300. With three right-side bars, the second pivot cannot be confirmed before bar 33 closes. A label drawn back on bar 30 must not be treated as an entry available on bar 30. TradingView's pivot plotting explanation describes this timing problem.

A confirmed divergence can still fail: price may continue making new lows, the gap effect may explain the disagreement, or a later price trigger may never occur. Closing-bar confirmation controls signal timing; it does not establish a profitable entry rule. The live ADL endpoint can change until the bar closes, and feed revisions can change historical values.

Plot ADL in Pine Script v6

Open TradingView's Pine Editor, create an indicator, paste this example and select Add to chart. It uses the built-in ta.accdist series with no arguments. The orange background marks bars where the volume value is missing; it does not repair the feed.

Pine Script v6
//@version=6
indicator("Accumulation Distribution [Pineify]", shorttitle="ADL", overlay=false)

float adl = ta.accdist
plot(adl, title="Accumulation Distribution", color=color.blue, linewidth=2)
bgcolor(na(volume) ? color.new(color.orange, 85) : na, title="Missing volume")

This example only plots ADL. It has no divergence detection, alerts, orders or performance report. Compare it with TradingView's built-in Accumulation/Distribution indicator on the same symbol and chart before adding custom conditions.

Turn a defined ADL rule into a script

Pineify's AI Coding Agent can draft and revise Pine Script from your requirements. Give it the pairing rule and timing constraints, then review the resulting code and chart events.

Create an ADL divergence indicator. Expose left and right price pivot lengths and minimum/maximum pivot spacing. Sample ADL at consecutive same-type price pivots. Mark bullish and bearish events only at the confirmation bar close, record the original pivot time, and suppress signals when required volume data is missing. Do not backdate alert markers.
Build an ADL script with Pineify

Generated code needs syntax and behavior checks. A successful compile does not validate the trading rule.

Questions about the A/D line

ADL accumulates volume weighted by where each bar closes within its high-low range. It is a price-and-volume proxy for pressure. It does not identify who traded, distinguish institutions from individuals, or measure cash entering an asset.

A bar can close below the previous close but above the midpoint of its own range. ADL then adds a positive volume contribution, while OBV subtracts volume. A gap down followed by a recovery inside the new bar is one example.

The basic ADL is cumulative and has no rolling lookback or fixed overbought threshold. Smoothing and divergence pivot lengths are optional additions. Compare changes over a defined interval rather than treating the absolute value or the zero line as a trading threshold.

For a bar with a nonzero range, zero volume contributes zero to both ADL and OBV. Missing volume is unavailable data, not a confirmed zero. Check the symbol and feed before interpreting a flat line, and do not manufacture volume to produce signals.

The open bar can change as its price range, close and volume update. A pivot-based divergence also requires later bars to confirm the pivot. Closing-bar checks and markers on the actual confirmation bar make that delay visible, but do not prevent provider data revisions or guarantee a reversal.

In Pine Script v6, ta.accdist is a built-in series variable. Use ta.accdist without parentheses or OHLC arguments. The example on this page plots the line; it does not generate divergence alerts or place orders.

Sources and limits

Sources checked October 16, 2026. Numerical examples are hypothetical and are not backtest results.

Educational information, not investment advice. ADL is derived from the selected price and volume feed. Divergence does not guarantee a reversal or a profitable trade.