Class WmaRTIndicator
java.lang.Object
com.wualabs.qtsurfer.engine.indicators.core.AbstractRTIndicator
com.wualabs.qtsurfer.engine.indicators.core.AbstractWindowSeriesRTIndicator
com.wualabs.qtsurfer.engine.indicators.averages.WmaRTIndicator
- All Implemented Interfaces:
Resettable, RTIndicator
Weighted Moving Average (WMA) RTIndicator.
Computes a linearly weighted moving average where recent values receive higher weights. Weight for position i (0-based, oldest first) is (i+1), so the most recent value gets weight equal to the window size.
Formula: WMA = Σ(weight_i × value_i) / Σ(weight_i)
This is the simple O(window) reference implementation. The pro tier ships an O(1) incremental
twin (indicators.averages.pro.WmaRTIndicator) that produces identical results.
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class AbstractWindowSeriesRTIndicator
getPeriods, isReady, onEvict, onReset, reset, window, windowSizeMethods inherited from class AbstractRTIndicator
equals, getDisplayHint, getMeta, getValue, hashCode, hide, isPoison, setValue, toString, toString, withDisplayHint, withMeta
-
Constructor Details
-
WmaRTIndicator
public WmaRTIndicator(int periods)
-
-
Method Details
-
update
public double update(double newValue) - Specified by:
updatein interfaceRTIndicator- Overrides:
updatein classAbstractRTIndicator
-