<!-- Generated by ta_codegen — do not edit. -->

# TA-Lib for Rust

[TA-Lib](https://ta-lib.org) — the widely used technical-analysis library — as a
pure-Rust crate: 161 indicators covering moving averages, momentum oscillators
(RSI, MACD, Stochastic), volatility (Bollinger Bands, ATR), volume, Hilbert
Transform cycle analysis, statistics, price transforms, and 61 candlestick
patterns.

Every function is generated from the same canonical definitions as the C library
and verified against the C reference implementation.

## Install

```toml
[dependencies]
ta-lib = "0.6"
```

## Quick start

```rust
use ta_lib::{Core, RetCode};

let close = [11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0];
let core = Core::new();
let mut sma = vec![0.0; close.len()];
let (mut out_beg, mut out_nb) = (0, 0);

let ret = core.sma(0, close.len() - 1, &close, 3, &mut out_beg, &mut out_nb, &mut sma);
assert_eq!(ret, RetCode::Success);
assert_eq!(sma[0], 12.0); // (11 + 12 + 13) / 3, at input index `out_beg` = 2
```

Every indicator is a method on `Core` with the same calling pattern: `&[f64]`
input slices, a `startIdx..=endIdx` range, caller-provided output slices, and a
`RetCode` result. `outBegIdx` reports the input index of the first output value;
`*_lookback` methods return how many leading values an indicator consumes.

## Documentation

- API reference: <https://docs.rs/ta-lib>
- Per-function reference (formulas, notes, sources): <https://ta-lib.org/functions/>
- Project home: <https://ta-lib.org>

## License

BSD-3-Clause — see [LICENSE](https://github.com/TA-Lib/ta-lib/blob/main/LICENSE).
