Expand description
Native Bollinger Bands — TA-Lib parity, incremental for every matype.
Both paths are streaming and bounded-memory:
MaType::Sma— O(1) amortised per bar viaRollingVariance, a shifted-data accumulator with a deterministic periodic exact refresh. It replaced asum/sum_sqpair whoseE[X²] - E[X]²evaluation lost ~1e-6 relative precision on slowly-varying inputs (quantwave-qkft).- every other
MaType— the middle band comes fromMaStream, and the deviation is a two-pass sum of squared deviations over a rolling window oftimeperiodinputs (O(timeperiod) per bar), exactly as the batchtalib_rs::overlap::bbandsnon-SMA path computes it.
The non-SMA path used to push every bar onto an ever-growing history and
re-run the batch bbands over the whole thing, i.e. O(n) per bar / O(n²)
per series plus an unbounded memory leak in long-running streams.
Structs§
- BBANDS
- Bollinger Bands — matches
talib_rs::overlap::bbandsfor everymatype.