Goal
Ship a production-ready streaming/stateful API so users can process ticks/candles in real time without passing full arrays.
Ideal usage direction:
const rsi = RSI({ period: 14 });
rsi.next(45.23);
rsi.next(46.10);
Why this matters
- Direct integration with websocket price feeds.
- Lower latency and allocations for live strategies.
- Strong differentiation vs array-only TA libraries.
Scope
- Define and document canonical stateful constructor style for v0.3 (factory or class-like API).
- Cover RSI/EMA/SMA in streaming form with consistent behavior.
- Keep/reset internal state deterministically.
Acceptance criteria
- Streaming APIs for RSI, EMA, and SMA are available and documented.
next(value) behavior is deterministic, including warmup and reset semantics.
- Streaming outputs match batch implementations on overlapping non-null windows (default tolerance
1e-10).
- README includes at least one websocket-like streaming example.
Test plan
- Unit tests for warmup, reset, invalid inputs, and edge cases.
- Parity tests against batch functions for RSI/EMA/SMA.
- Golden/compat updates when applicable.
Goal
Ship a production-ready streaming/stateful API so users can process ticks/candles in real time without passing full arrays.
Ideal usage direction:
Why this matters
Scope
Acceptance criteria
next(value)behavior is deterministic, including warmup and reset semantics.1e-10).Test plan