Summary
MovingAverageEnvelope is RTTA's streaming implementation of: Percentage envelope bands above and below a simple moving average.
Update API
result = rtta.MovingAverageEnvelope().update(value)
The update(...) call consumes one observation using value. advance(...)
uses the same inputs when the caller wants to update state without materializing
a Python return value.
Theory Of Operation
MovingAverageEnvelope places fixed percentage bands around a simple moving
average. Unlike Bollinger bands, the width does not depend on recent volatility;
percent is a fraction (for example 0.025 for 2.5% bands).
Recurrence
Let \(z_t = value_t\), \(n\) the window, and \(p\) the envelope fraction.
update(...) returns a result struct with fields middle, upper, lower.
Composed Primitives
Implementation Notes
The recurrence is implemented in src/rtta/indicator.cpp in class MovingAverageEnvelope.
