# Accumulation/Distribution Line

`D07-F05-A02` · Technical Indicators → Volume Indicators · archetype `series-transform` · difficulty 2/5 · verification **verified**

Full page: https://docs.thefintechbuilder.com/technical-indicators/volume-indicators/accumulation-distribution-line/
Agent skill: `npx skills add IslamBaraka90/Fintech-Algorithms-Library` — https://docs.thefintechbuilder.com/guides/agent-skill/

## Install and import

```bash
npm install fintech-algorithms
```

```ts
import { accumulationDistributionLine } from "fintech-algorithms/technical-indicators/volume-indicators/accumulation-distribution-line";
```

## Signature

```ts
accumulationDistributionLine(high, low, close, volume, initial)
```

Weights each bar's volume by where the close sat within that bar's range, then accumulates. Unlike OBV it distinguishes a close at the high from a close barely above the open.

## Parameters

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `high` | `number[]` | yes | Per-bar high prices, chronological. |
| `low` | `number[]` | yes | Per-bar low prices, chronological. |
| `close` | `number[]` | yes | Per-bar closing prices, chronological. |
| `volume` | `number[]` | yes | Per-bar traded volume, aligned index-for-index with the price series. |
| `initial` | `number` | no | Starting value of the accumulation. · default: 0 |

## Returns

`Record<string, (number | null)[]>` · length same-as-input

Parallel series: `range`, `money_flow_multiplier`, `volume`, `money_flow_volume` and `adl`.

## Warm-up

The first `0` positions are `null`. Defined from the first bar; a zero-range bar contributes nothing rather than dividing by zero.

## Errors

- When the input series are not all the same length — throws RangeError

## Complexity

Time `O(n)`, space `O(n)`.

## Worked example

Captured by running this function on the input its own test provides. Real output of real code — but not asserted against a published figure.

### Input

`high`:

```json
[101.05, 101.52482, 102.098461, 102.729464, 103.36806, 103.963227]
```

Showing 6 of 120 elements.

`low`:

```json
[99.4, 99.462904, 99.936275, 100.512674, 101.151059, 101.802588]
```

Showing 6 of 120 elements.

`close`:

```json
[100.28, 100.686113, 101.200346, 101.789282, 102.408843, 103.010585]
```

Showing 6 of 120 elements.

`volume`:

```json
[990000, 1066468.036, 1130033.236, 1170141.961, 1180511.26, 1160272.794]
```

Showing 6 of 120 elements.

### Call

```ts
accumulationDistributionLine(high, low, close, volume, initial)
```

### Returns

object with 5 fields: range, money_flow_multiplier, volume, money_flow_volume, adl

```json
{
  "range": [
    1.6499999999999915,
    2.0619160000000107,
    2.1621860000000055,
    2.216789999999989,
    2.2170009999999962,
    2.1606390000000033
  ],
  "money_flow_multiplier": [
    0.06666666666666667,
    0.1864780136533253,
    0.16925278398805474,
    0.1517626838807486,
    0.1346715675816141,
    0.118184944361371
  ],
  "volume": [990000, 1066468.036, 1130033.236, 1170141.961, 1180511.26, 1160272.794],
  "money_flow_volume": [
    66000,
    198872.84097804304,
    191261.2711920305,
    177583.88452284224,
    158981.30193194642,
    137126.7756029025
  ],
  "adl": [
    66000,
    264872.84097804304,
    456134.11217007355,
    633717.9966929158,
    792699.2986248622,
    929826.0742277647
  ]
}
```

## Other exports

`obv`, `chaikinMoneyFlow`, `moneyFlowIndex`, `volumePriceTrend`, `forceIndex`. Every module additionally exports `run` as an alias of its primary
function, and a `meta` object carrying its catalog id, domain, family, shape and article URL.

## Verification and provenance

Tier: **verified** (via scenario-fixture).

The worked example below is the figure published in this algorithm's article, replayed and asserted by the test suite on every build. The arithmetic cannot drift without the build failing.

Both tiers guarantee the signature. Full explanation: https://docs.thefintechbuilder.com/guides/verification/

Generated from the docs.json payload shipped inside fintech-algorithms@0.13.1.
The signature and parameter list are checked against the compiled implementation at build time,
so a description that contradicts the code fails the build rather than reaching this file.

## Links

- Article (how it works, step by step): https://thefintechbuilder.com/technical-indicators/volume-indicators/accumulation-distribution-line/
- Implementation source: https://github.com/IslamBaraka90/Fintech-Algorithms-Library/blob/main/src/technical-indicators/volume-indicators/accumulation-distribution-line/impl.ts
- Package on npm: https://www.npmjs.com/package/fintech-algorithms
- Domain index for agents: https://docs.thefintechbuilder.com/technical-indicators/llms.txt
