# `TAlib.Indicators.ChaikinAD`
[🔗](https://github.com/benyblack/talib/blob/main/lib/indicators/chaikin_ad.ex#L1)

Chaikin Accumulation/Distribution line and oscillator.

With the Close Location Value
`CLV = ((close - low) - (high - close)) / (high - low)`:

* `AD` accumulates `CLV * volume` across bars (zero-range bars
  contribute nothing)
* `ADOSC = EMA(CLV * volume, fast) - EMA(CLV * volume, slow)`

Bars are maps with at least `:high`, `:low`, `:close` and `:volume`.
See `TAlib` for the conventions.

# `ad`

```elixir
@spec ad([map()]) :: float() | nil
```

The latest value of the Chaikin A/D line.

## Parameters

  - bars: list of bars, oldest first.

## Examples

    iex> TAlib.Indicators.ChaikinAD.ad([
    ...>   %{high: 11, low: 9, close: 10, volume: 100},
    ...>   %{high: 12, low: 8, close: 11, volume: 200}
    ...> ])
    100.0

# `ad_list`

```elixir
@spec ad_list([map()]) :: [float()]
```

The Chaikin A/D line for every bar.

    iex> TAlib.Indicators.ChaikinAD.ad_list([
    ...>   %{high: 11, low: 9, close: 10, volume: 100},
    ...>   %{high: 12, low: 8, close: 11, volume: 200}
    ...> ])
    [0.0, 100.0]

# `adosc`

```elixir
@spec adosc([map()], pos_integer(), pos_integer()) :: float() | nil
```

The Chaikin A/D oscillator: `EMA(flow, fast) - EMA(flow, slow)`,
defined from index `slow - 1` on.

## Parameters

  - bars: list of bars, oldest first.
  - fast: fast EMA period, a positive integer (default 3).
  - slow: slow EMA period, a positive integer (default 10).

## Examples

    iex> TAlib.Indicators.ChaikinAD.adosc(
    ...>   [
    ...>     %{high: 11, low: 9, close: 10, volume: 100},
    ...>     %{high: 12, low: 8, close: 11, volume: 200}
    ...>   ],
    ...>   2,
    ...>   2
    ...> )
    0.0

---

*Consult [api-reference.md](api-reference.md) for complete listing*
