LearnForexHub
Indicator

Accumulation/Distribution (A/D): Volume Weighted by Close Strength

Written by , Founder & EditorLast updated How we write and review lessons

Accumulation/Distribution (A/D) is a cumulative volume-flow indicator, in the same family as On-Balance Volume — it keeps a single running total that only ever grows or shrinks bar by bar, rather than resetting into a bounded range like an oscillator. Where OBV decides a bar's contribution purely by whether the close was higher or lower than the previous close, A/D looks at where inside that bar's own range the close landed, and weights it by that bar's volume. That extra piece of information — how strong the close was relative to the bar's own high and low, not just relative to the last bar's close — is what separates A/D from OBV, and it's the detail the rest of this lesson builds on.

How A/D Is Calculated

A/D updates in two steps for every bar. First it computes the Close Location Value (CLV), a number between -1 and +1 that measures where the close sat inside the bar's high-low range:

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

A close at the very top of the bar's range gives CLV = +1; a close at the very bottom gives CLV = -1; a close exactly in the middle gives CLV = 0. Second, that CLV is multiplied by the bar's volume and added to the running total:

A/D = Previous A/D + (CLV × Volume)

A bar that closes near its high on heavy volume adds a large positive amount; a bar that closes near its low on heavy volume subtracts a large amount; a bar with a close near the middle of its range contributes almost nothing regardless of volume, because CLV is close to zero. This is the mechanical difference from OBV: OBV treats every up-close bar identically regardless of how strong the close was within its range, while A/D scales its contribution by exactly that strength. A weak up-close near the bottom of a wide-ranging bar barely moves A/D, even though OBV would have added that bar's full volume.

Reading A/D: Confirmation, Not Zones

PriceNew highAccumulation/Distribution (cumulative, unbounded)A/D flattens
Price prints a new high while A/D stalls instead of confirming it — a bearish divergence warning that the rally lacks real buying pressure behind it

Like OBV, A/D has no overbought or oversold zone and no fixed threshold — there's nothing to compare its raw value against, since a reading of 500,000 or -3 million carries no meaning on its own. What matters is the shape of the line next to the shape of price, bar for bar. The diagram above shows the pattern worth training your eye on: price climbing into a series of higher highs while A/D fails to keep pace, flattening or rolling over instead of confirming each new high. That's the core reading habit — never look at A/D in isolation, always compare it against what price is doing over the same stretch of bars.

When A/D climbs in step with price, each new high is backed by closes that landed strong within their range on real volume, which is what participation behind a genuine trend looks like. When A/D lags, stalls, or diverges from price, the move is happening on weaker closes than the price chart alone suggests, which is the subject of the next section.

Divergence: Where A/D Earns Its Keep

A/D's real value, like OBV's, isn't as a standalone entry trigger — it's as a check on whether a price move has genuine strength behind it. Bearish divergence happens when price prints a new high but A/D fails to print a new high alongside it, instead flattening or ticking down while price keeps grinding upward — the closes driving that rally aren't landing near the top of their bars' ranges anymore, even if price nominally keeps rising. That's a warning that the move may be running on fumes, not proof that a reversal is imminent — divergence can persist for a stretch before it resolves, so it's a cue to tighten risk management or look for confirmation elsewhere rather than an automatic exit signal.

Bullish divergence is the mirror case at lows: price makes a new low, but A/D holds above its prior trough instead of confirming it. That suggests the down-closes aren't landing as strongly near the bottom of their ranges as the price low implies, which is often what shows up right before selling pressure exhausts itself and buyers step back in.

Because A/D weights by close location within the bar rather than just close-over-close direction, it can occasionally pick up on strength or weakness that OBV misses — a bar that closes higher than the prior bar but weakly near its own low still counts as a full "up" bar for OBV, while A/D correctly registers it as a mediocre bar. In practice, treat an A/D divergence the same way you'd treat an OBV one: a heads-up to watch price structure more closely, not a trigger to act on by itself.

Entry Conditions: The Signal-Average Cross

A/D has no natural centerline to alert on any more than OBV does, so the included indicator manufactures one the same way: it computes a simple moving average of A/D itself over a configurable SignalPeriod (20 bars by default) and watches for A/D to cross that average.

  • BUY signal — A/D crosses above its own signal average, suggesting the balance of volume-weighted closes has just turned positive relative to its recent trend.
  • SELL signal — A/D crosses below its own signal average, suggesting the balance has just turned negative relative to its recent trend.

This signal average is calculated manually inside the alert code, since A/D itself has nothing built in to cross. Treat the cross as a timing tool for shifts in the underlying line's momentum, best combined with the divergence read above and with actual price structure — not fired blindly as a standalone signal.

Parameters

  • AppliedVolume (MT5 only, default VOLUME_TICK) — which volume series feeds the A/D calculation. MQL4's iAD() always uses tick volume directly, with no equivalent input.
  • SignalPeriod (default 20) — the lookback window for the signal moving average that A/D crosses to generate alerts. Shorter periods react faster but produce more whipsaw crosses; longer periods smooth the signal line and fire less often.
  • EnableAlert (default true) — pop up a terminal alert the moment A/D crosses its signal average.
  • EnablePush (default false) — also send a push notification to your phone via MetaTrader's mobile app.

A/D vs OBV: Two Ways to Weight Volume

A/D and OBV are close cousins — both are cumulative, unbounded volume-flow lines with no zones to watch — but they disagree on how much of a bar's volume counts. OBV is binary: a bar's entire volume gets added or subtracted based purely on whether the close was higher or lower than the previous bar's close, with no regard for how convincingly. A/D is proportional: it scales each bar's contribution by exactly where the close landed inside that bar's own high-low range, so a strong close near the extreme of the range counts far more than a weak, barely-higher close near the middle.

In practice this makes A/D somewhat more sensitive to the quality of a bar's close, while OBV is a cleaner read of simple directional volume flow. Neither is strictly better — traders sometimes run both side by side and treat agreement between them as a stronger confirmation signal than either alone, since a divergence that shows up on both A/D and OBV together is harder to dismiss as noise from one indicator's particular quirks.

The Forex Volume Caveat

The same caveat that applies to OBV applies here, and it's worth restating because A/D leans on volume just as directly. Forex has no central exchange, so there's no single authoritative record of real traded volume — what MetaTrader supplies is tick volume, a count of price updates during a bar, and that's what feeds A/D's calculation (made explicit by the MQL5 build's VOLUME_TICK default, since true VOLUME_REAL generally isn't available for currency pairs at all).

Tick volume correlates reasonably well with genuine trading activity, but it's a proxy tied to your specific broker's quote stream, not a direct count of contracts or lots traded. That means the exact shape of your A/D line can differ somewhat between brokers for the identical pair and timeframe. This doesn't make A/D useless on forex — the confirmation and divergence patterns still hold up in practice — but keep in mind you're reading accumulated quoting intensity weighted by close strength, not literal traded volume, especially before leaning heavily on a marginal divergence call.

A Word of Caution

A/D shares OBV's core limitation: it has no absolute scale to check against, so its value only means anything relative to where it was earlier on the same chart, not compared across different symbols or time spans. A handful of unusually wide-range, high-volume bars can dominate the running total for a long stretch afterward, which can make the line look like it's trending even when recent bars have been unremarkable. Use A/D to confirm or question what price and market structure are already telling you (see Trend vs Range for reading that structure first) rather than as an isolated trigger, and always size positions with a defined stop before acting on any signal — see Risk Management Basics for the position-sizing math.

Download the Indicator

This custom indicator calculates Accumulation/Distribution in a separate window and automatically alerts when A/D crosses its own signal moving average. It's available for both MetaTrader 4 and MetaTrader 5 below.

Download accumulation-distribution-alert.mq4

For MetaTrader 4 — this is source code (.mq4), open and review it fully before using it.

Download File

Download accumulation-distribution-alert.mq5

For MetaTrader 5 — this is source code (.mq5), open and review it fully before using it.

Download File

How to install

MetaTrader 4

  1. Download accumulation-distribution-alert.mq4 above.
  2. Open MetaTrader 4FileOpen Data Folder.
  3. Place the file in the MQL4/Indicators folder.
  4. Restart MetaTrader 4, then drag it from the Navigator window onto a chart.

MetaTrader 5

  1. Download accumulation-distribution-alert.mq5 above.
  2. Open MetaTrader 5FileOpen Data Folder.
  3. Place the file in the MQL5/Indicators folder.
  4. Restart MetaTrader 5, then drag it from the Navigator window onto a chart.

Both files are source code. Open and read them in MetaEditor before running them on any account.