Class MacdRTIndicator
java.lang.Object
com.wualabs.qtsurfer.engine.indicators.core.AbstractRTIndicator
com.wualabs.qtsurfer.engine.indicators.core.AbstractIncrementalRTIndicator
com.wualabs.qtsurfer.engine.indicators.core.AbstractDecorableIncrementalRTIndicator
com.wualabs.qtsurfer.engine.indicators.momentum.MacdRTIndicator
- All Implemented Interfaces:
ClockAware, Resettable, RTIndicator
MACD RTIndicator
-
Constructor Summary
ConstructorsConstructorDescriptionMacdRTIndicator(RTIndicator indicator) MacdRTIndicator(RTIndicator indicator, int shortEmaPeriods, int longEmaPeriods) -
Method Summary
Methods inherited from class AbstractDecorableIncrementalRTIndicator
getIndicator, nextValue, setClockSupplierMethods inherited from class AbstractIncrementalRTIndicator
getLastUpdateValue, getPeriodCycles, getPeriods, getPrevValue, initValue, isPeriodic, isReady, prevNextValue, setPeriods, tickValueMethods inherited from class AbstractRTIndicator
equals, getDisplayHint, getMeta, getValue, hashCode, hide, isPoison, setValue, toString, toString, withDisplayHint, withMeta
-
Constructor Details
-
MacdRTIndicator
public MacdRTIndicator() -
MacdRTIndicator
-
MacdRTIndicator
-
-
Method Details
-
reset
public void reset()- Specified by:
resetin interfaceResettable- Overrides:
resetin classAbstractDecorableIncrementalRTIndicator
-
update
public double update(double newValue) Computes the MACD line as the difference between the short-period EMA and the long-period EMA. Both EMAs are updated with the same input value, and the difference is passed to the parent incremental pipeline.- Specified by:
updatein interfaceRTIndicator- Overrides:
updatein classAbstractDecorableIncrementalRTIndicator- Parameters:
newValue- the new input price- Returns:
- the MACD line value (shortEMA - longEMA)
-