Skip to content

v0.3 Gate: Streaming/Stateful API (real-time first) #2

@TDamiao

Description

@TDamiao

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood entry-level tasks with clear acceptance criteria.help wantedExtra help is welcome from the community.v0.3Release gate work required before shipping v0.3.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions