ADL (Accumulation/Distribution Line)
The ADL measures cumulative money flow by combining price and volume. Unlike OBV which uses the full volume, ADL weights the volume by where the close falls within the high-low range.
Declaration
function init(ctx) { ctx.indicator('adl', 'ADL', {}); }
Options
ADL requires no options. It uses high, low, close, and volume data automatically.
Output
Returns a single number[] series (cumulative).
Accessing Values
function onBar(ctx, i) { const adl = ctx.ind.adl[i]; }
Use Cases
Divergence Detection
function onBar(ctx, i) { const priceUp = ctx.series.close[i] > ctx.series.close[i - 10]; const adlUp = ctx.ind.adl[i] > ctx.ind.adl[i - 10]; // Price rising but ADL falling = distribution (bearish) if (priceUp && !adlUp) { ctx.order.close('ASSET', { signal: 'sell', reason: 'adl_divergence' }); } // Price falling but ADL rising = accumulation (bullish) if (!priceUp && adlUp) { ctx.order.market('ASSET', 1, { signal: 'buy', reason: 'adl_accumulation' }); } }
Calculation
- Money Flow Multiplier = $\frac{(Close - Low) - (High - Close)}{High - Low}$
- Money Flow Volume = Multiplier x Volume
- ADL = cumulative sum of Money Flow Volume
Related
indicatoradlvolumeaccumulationdistributionqsl