Goal
Introduce a shared rolling-window engine to improve performance consistency and reduce duplicated math logic.
Why
Multiple indicators can reuse the same rolling primitives (mean/std/min/max/sum), reducing bug surface and warmup drift.
Implementation prompt
Create internal rolling core (e.g., src/core/rolling.ts) with reusable stateful + batch helpers:
- rolling sum/mean
- rolling std
- rolling min/max
- warmup-aware null behavior
Refactor selected indicators to use rolling core where it improves clarity/performance.
Scope
- Internal module first (no immediate public API required)
- Deterministic semantics matching current outputs
- Micro-benchmarks before/after for key indicators
Acceptance criteria
- No behavioral regression in golden tests
- Reduced duplicated rolling logic in overlap/volatility modules
- Benchmarks show equal or better performance on 10k/100k runs
- Dev notes document warmup/alignment invariants
Test plan
- Existing test suite + golden unchanged outputs
- New unit tests for rolling primitives and edge windows
- Benchmark comparison report attached to PR
Goal
Introduce a shared rolling-window engine to improve performance consistency and reduce duplicated math logic.
Why
Multiple indicators can reuse the same rolling primitives (mean/std/min/max/sum), reducing bug surface and warmup drift.
Implementation prompt
Create internal rolling core (e.g.,
src/core/rolling.ts) with reusable stateful + batch helpers:Refactor selected indicators to use rolling core where it improves clarity/performance.
Scope
Acceptance criteria
Test plan