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.
| Bar | Previous close; high / low / close | ADL change | OBV change |
|---|---|---|---|
| Gap down, close near high | 110; 104 / 100 / 103 | +500 | -1,000 |
| Gap up, close near low | 100; 110 / 106 / 107 | -500 | +1,000 |
| Same close, upper half of range | 103; 104 / 100 / 103 | +500 | 0 |
| Zero reported volume | 110; 104 / 100 / 103; volume 0 | 0 | 0 |
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.
- Choose the number of bars on each side of a price pivot and a permitted distance between consecutive pivots.
- Sample ADL at the price pivot bar. Compare it with ADL at the previous same-type price pivot.
- Wait for the right-side bars to close, then plot the event on that confirmation bar. Keep the original pivot time separately.
- 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.
//@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
Sources and limits
- TradingView: Accumulation Distribution calculation and gap limitation
- TradingView: On Balance Volume calculation
- TradingView: repainting, pivot confirmation and dataset changes
- TradingView: Pine Script v6 reference
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.