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

Momentum [Wikipedia](https://en.wikipedia.org/wiki/Momentum_(technical_analysis)).

`MOM = price - price_period_bars_ago`

See `TAlib` for the input conventions: prices are always given in
chronological order, oldest first, and the series is returned aligned
with the input. `nil` is returned when there is not enough data.

# `momentum`

```elixir
@spec momentum([number()], pos_integer()) :: number() | nil
```

Calculate the latest Momentum.

## Parameters

  - prices: list of prices, oldest first.
  - period: how many bars back to compare against, a positive integer (default 14).

## Examples

    iex> TAlib.Indicators.Momentum.momentum([1, 2, 4, 8], 2)
    6

# `momentum_list`

```elixir
@spec momentum_list([number()], pos_integer()) :: [number() | nil]
```

Calculate the full Momentum series in a single pass.

Returns a list aligned with `prices`: the first `period` entries are
`nil`, and every later entry is the price change over `period` bars.

## Parameters

  - prices: list of prices, oldest first.
  - period: how many bars back to compare against, a positive integer (default 14).

## Examples

    iex> TAlib.Indicators.Momentum.momentum_list([1, 2, 4, 8], 2)
    [nil, nil, 3, 6]

---

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