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

Technical analysis library for Elixir.

## Conventions

* Prices are always given in **chronological order, oldest price first**.
  Series functions (`TAlib.Indicators.MA.sma_list/2`, `TAlib.Indicators.RSI.rsi_list/2`,
  ...) return results aligned with the input list, `nil`-padded while the
  lookback window fills up; scalar functions return the value at the
  latest point.
* Bar-based indicators (`TAlib.Indicators.ATR`, `TAlib.Indicators.ADX`,
  `TAlib.Indicators.CCI`, `TAlib.Indicators.Keltner`, `TAlib.Indicators.Donchian`,
  `TAlib.Indicators.MFI`, `TAlib.Indicators.OBV`, `TAlib.Indicators.VWAP`)
  take maps with the keys they need — `%{high: , low: , close: }` plus
  `%{volume: }` for volume-based ones; extra keys are ignored.
* Lookback periods must be positive integers; any other value raises
  `ArgumentError`.
* Functions return `nil` — never `0` — when there is not enough data,
  since `0` is a legitimate reading for several indicators.
* For live feeds, several modules also expose streaming state:
  `init` warms up from history (one pass, returning the same series
  as the batch function plus the opaque state) and `next` advances
  one bar in O(1) — the streamed series continues the batch series
  exactly.

---

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