# quant-indicators
Pure-math technical indicators for Rust. Decimal-backed, zero I/O, zero async, WASM-compatible.
Indicator outputs match TradingView / Bloomberg / MetaTrader where conventions exist (e.g. RSI uses Wilder's smoothing, Bollinger uses population stddev, ATR uses Wilder's method with `H-L` first TR).
## Install
```toml
[dependencies]
quant-indicators = "0.4"
quant-primitives = "0.4" # for Candle, Interval
```
## Indicators
| Moving averages | `Sma`, `Ema`, `Wma`, `HullMa`, `Ma` (enum dispatch) |
| Momentum | `Rsi` (Wilder), `Macd`, `Momentum`, `EfficiencyRatio` (Kaufman) |
| Volatility | `BollingerBands`, `Atr` (Wilder), `StdDev`, `VarianceRatio` (Lo-MacKinlay) |
| Trend | `Supertrend` (ATR-based, TF-agnostic), `DetrendedOscillator` |
| Volume | `VolumeSignalIndicator` |
| Portfolio | `Hrp` (de Prado, recursive bisection with inverse-variance) |
| Combinators | `Diff`, `Ratio`, `Lag`, `Scale`, `Close` |
| Synthesis | `synthesize_ratio_candles` (OHLC from two series) |
All indicators implement the `Indicator` trait (streaming push-based update).
## Example
```rust
use quant_indicators::{Indicator, Rsi};
use rust_decimal_macros::dec;
let mut rsi = Rsi::new(14);
for close in [dec!(100), dec!(102), dec!(101), dec!(103) /* ... */] {
rsi.update(close);
}
let value = rsi.value();
```
## Audit
See `AUDIT-VERDICT.md` at the workspace root for formula correctness, numerical stability, and convention notes (reviewed by Claude Opus agent personas — not a human-conducted audit).
## License
MIT — see [LICENSE-MIT](../../LICENSE-MIT).