OPEN SOURCE · UPSTREAM CONTRIBUTION

NautilusTrader

Correctness and performance work around the Rust-native Aroon oscillator in an open-source, production-grade multi-asset trading engine.

What NautilusTrader is

NautilusTrader is an open-source, production-grade, Rust-native engine for multi-asset and multi-venue trading systems. It combines research, deterministic simulation and live execution in one event-driven architecture, with Python serving as a control plane for strategy logic, configuration and orchestration.

Contribution trail

Two issue-level contributions around the same indicator, with the correctness fix now merged upstream.

3 items
check_circle Issue · completed
#4995 · fixed by #5037

AroonOscillator accepts MAX_PERIOD but cannot retain its required period + 1 window

ExcerptAt the accepted maximum period, the oscillator needed 1,025 highs and lows but its wrapping deques could only hold 1,024. Pushing the next observation could evict the oldest value before calculation, so the implementation's storage invariant and public constructor contract disagreed.

The report reproduced the failure against the published v2.0.0rc5 pre-release and showed an observable signal error: the unique oldest high could be lost at the boundary, changing Aroon Up from the expected 0.0 to 100.0 and the oscillator value from -100.0 to 0.0.

Bug reportBoundary invariantRuntime reproduction
lightbulb Open RFC
#4996 · performance proposal

Consider amortized O(1) rolling extrema for AroonOscillator

ExcerptAfter initialization, every Aroon update currently rescans the full high window and the full low window. The RFC proposes maintaining monotonic deques so each observation enters and leaves once, moving the stream path from O(Np) toward O(N) while keeping storage at O(p).

The proposal explicitly preserves Aroon's current tie semantics where equal highs or lows resolve to the most recent occurrence, and recommends benchmarking representative periods before accepting the additional state and implementation complexity.

RFCAlgorithmsPerformanceMonotonic dequeO(1) amortized

Contribution approach

This contribution combines reproducible boundary-case investigation, a narrowly scoped correctness patch, cross-language regression coverage, and a separate performance proposal rather than mixing optimization into the bug fix.