Class KamaRTIndicator
java.lang.Object
com.wualabs.qtsurfer.engine.indicators.core.AbstractRTIndicator
com.wualabs.qtsurfer.engine.indicators.averages.KamaRTIndicator
- All Implemented Interfaces:
Resettable, RTIndicator
Kaufman Adaptive Moving Average (KAMA) RTIndicator.
KAMA adapts its smoothing constant based on market efficiency: trending markets get faster smoothing, choppy markets get slower smoothing.
Formula:
- ER = |close - close_n| / Σ|close_i - close_{i-1}| (efficiency ratio)
- SC = (ER × (fastSC - slowSC) + slowSC)² (smoothing constant)
- KAMA = prevKAMA + SC × (close - prevKAMA)
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class AbstractRTIndicator
equals, getDisplayHint, getMeta, getValue, hashCode, hide, isPoison, setValue, toString, toString, withDisplayHint, withMeta
-
Constructor Details
-
KamaRTIndicator
public KamaRTIndicator() -
KamaRTIndicator
public KamaRTIndicator(int erPeriod, int fastPeriod, int slowPeriod)
-
-
Method Details
-
isReady
public boolean isReady()Description copied from interface:RTIndicatorReturns whether this indicator has received enough data to produce meaningful values.During the warmup period,
RTIndicator.getValue()may return 0 or a partial estimate that should not be used for trading decisions. Once this method returnstrue, the indicator's output is statistically valid.The default implementation returns
truefor backward compatibility. Indicators with warmup requirements should override this method.For composite indicators (e.g. Bollinger Bands, MACD), readiness is determined by the slowest internal component.
- Returns:
trueif the indicator has completed its warmup period
-
reset
public void reset()- Specified by:
resetin interfaceResettable- Overrides:
resetin classAbstractRTIndicator
-
update
public double update(double newValue) - Specified by:
updatein interfaceRTIndicator- Overrides:
updatein classAbstractRTIndicator
-