OPEN-SOURCE SCRIPT

Accumulation Distribution Divergence

433
Overview

Accumulation Distribution Divergence turns Chaikin's Accumulation/Distribution line into a bounded pane oscillator and runs a price/oscillator divergence engine on it, with a built-in forward-calibration harness that measures whether those divergences have actually preceded a move on your instrument. It is an analytical study of accumulation versus distribution — not a strategy, not a signal, not a recommendation.

What it measures — and why it is not another CVD/MFI tool

The A/D line measures a different physical quantity from the volume oscillators most traders already run. Cumulative Volume Delta signs an entire bar's volume by tick direction; the Money Flow Index weights volume by typical price. The A/D line instead weights each bar's volume by its Close-Location-Value — how close the bar finishes to its high versus its low — so a bar that opens weak but closes on its high still accumulates. Because the input quantity is different, an A/D-line divergence is an independent read of who is in control, not a restatement of a signed-tick or typical-price oscillator. That independence is the entire point of running it alongside your existing volume tools.

How the three components work together (why they are combined)

This is a deliberate three-part construction, not a random stack. Each part answers a question the previous one leaves open:


The oscillator answers "is volume accumulating or distributing right now?" — the raw A/D line drifts endlessly and can't be read on a fixed scale, so it is detrended (subtract its EMA), z-scored over a window to put it on a portable σ axis, and tanh-squashed to a soft ±100 pane where 0 is balance and the ±50 bands mark an accumulation/distribution edge.
The divergence engine answers "is that flow diverging from price?" — it compares confirmed price pivots to the oscillator at those pivots. Regular divergence (price makes a new extreme, flow does not) flags thinning conviction; hidden divergence flags trend continuation. Divergence alone, though, is famously prone to firing early and often.

The calibration harness answers the question every divergence tool leaves unanswered: "has this class of divergence actually paid on this symbol?" Every regular divergence is queued and resolved a fixed horizon later against the unconditional same-horizon base rate, and the dashboard reports Hit % / Edge / sample size with a Wilson-score-gated star. A divergence that never beats the base rate is adding no information — and now you can see that instead of assuming it.


Together: a distinct volume lens, a divergence read on it, and an honesty layer that tells you whether the read is worth anything on the instrument in front of you.

How to use it


Read the oscillator's side and slope — above 0 is net accumulation, below 0 is net distribution.

Treat a divergence mark as context (conviction thinning or trend confirming), never as a standalone entry. It marks a condition, not a trade.

Read the dashboard before you weight a divergence: if the Bull/Bear Edge is not clearly positive with an adequate sample and a star, that class is not carrying an edge on this instrument right now.

Combine with your own level/trend framework and risk rules. This tool describes behaviour; it does not decide anything for you.


Settings

Five grouped sections: Data source (High/Low series for the pivots — configurable so the engine runs on any market), A/D engine (detrend EMA and normalization window), Divergence (pivot strength, max bars between pivots, hidden on/off, connecting lines), Calibration (forward horizon, minimum sample for stars), and Dashboard & theme (position, auto/dark/light palette that reads the chart background so the table stays legible, and the bull/bear colours).

Universality & data note

High/Low are inputs, so the divergence engine works on any symbol or timeframe. The A/D line, however, needs real volume — on a no-volume symbol (like a cash index) the dashboard reads "no volume" and no signals fire. Use the futures contract. Defaults target liquid index-futures intraday; change the sources and lengths for any other asset.

Non-repainting

Pivots confirm a fixed number of bars after the fact and do not move once printed. The calibration harness logs and resolves only on confirmed bars, so its statistics never repaint. The live oscillator value updates each bar, like any oscillator.

Originality

The Accumulation/Distribution line and Close-Location-Value are Marc Chaikin's public concepts; the Wilson score interval is Edwin B. Wilson's; price/oscillator divergence is a standard public technique. What is original here is the specific construction: the detrend → z-score → tanh-squash oscillator that makes the A/D line readable on a fixed bounded scale, the combined regular+hidden divergence engine keyed to that oscillator, and — most importantly — the forward-calibration harness that scores each divergence class against its unconditional base rate with a Wilson-gated confidence read. This is a clean-room implementation; no third-party script code is reused.

Concept credits


Accumulation/Distribution line & Close-Location-Value — Marc Chaikin
Wilson score confidence interval — Edwin B. Wilson
Price/oscillator divergence — standard public technical-analysis technique


Disclaimer

Educational / informational only. Not financial advice, not a signal, not a recommendation. The oscillator describes past volume-and-location behaviour; the edge figures are in-sample, forward-measured at a fixed horizon over overlapping windows, with no costs, slippage or stops — read them as context, not a verified backtest. Past behaviour does not assure future behaviour. Markets carry risk. Do your own research and paper-trade before risking capital; you alone are responsible for your decisions.

Отказ от ответственности

Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.