Class StreamingIndicators.Sma
java.lang.Object
com.quantfinlib.indicators.StreamingIndicators.Sma
- Enclosing class:
StreamingIndicators
Simple moving average over a fixed window; NaN until the window fills.
The running sum is recomputed exactly from the window every
period updates (amortised O(1)), so add/subtract rounding
cannot drift over 10⁸ ticks; the schedule matches the batch
Indicators.sma(double[], int) so the two stay bit-identical.-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Sma
public Sma(int period)
-
-
Method Details
-
update
public double update(double v) -
value
public double value()
-