TAlib

Technical analysis library for Elixir.

Indicators

All 133 TA-Lib functions are covered — see PARITY.md for the function-by-function map. The Hilbert-transform family and MAMA are faithful translations of the TA-Lib C reference, cross-verified series for series.

Bar-based indicators take maps such as %{open: o, high: h, low: l, close: c, volume: v} with the keys they need — extra keys are ignored.

Installation

The package can be installed by adding talib to your list of dependencies in mix.exs:

def deps do
  [
    {:talib, "~> 0.7"}
  ]
end

Conventions

Examples

iex> TAlib.Indicators.MA.sma([1330.95, 1334.65, 1340.0], 3)
1335.2

iex> TAlib.Indicators.MA.sma_list([1, 2, 3, 4, 5], 3)
[nil, nil, 2.0, 3.0, 4.0]

iex> TAlib.Indicators.RSI.rsi([6, 1, 4, 2, 5, 3], 3) |> Float.round(4)
42.8571

iex> TAlib.Indicators.MACD.macd_all(prices)
%{macd: 20.36, signal: 12.28, histogram: 8.08}

More examples can be found in the module documentation (Hexdocs) and in the test suite.