Class KnowSureThingRTIndicator
java.lang.Object
com.wualabs.qtsurfer.engine.indicators.core.AbstractRTIndicator
com.wualabs.qtsurfer.engine.indicators.momentum.pro.KnowSureThingRTIndicator
- All Implemented Interfaces:
Resettable, RTIndicator
Know Sure Thing (KST) — Martin Pring's multi-timeframe ROC oscillator — with O(1) per-tick
computation.
KST = SMA(ROC(10),10)*1 + SMA(ROC(15),10)*2 + SMA(ROC(20),10)*3 + SMA(ROC(30),15)*4 Signal = SMA(KST, 9)
Default params: ROC periods [10,15,20,30], SMA periods [10,10,10,15], weights [1,2,3,4], signal period 9.
-
Constructor Summary
ConstructorsConstructorDescriptionKnowSureThingRTIndicator(int[] rocPeriods, int[] smaPeriods, double[] weights, int signalPeriod) -
Method Summary
Methods inherited from class AbstractRTIndicator
equals, getDisplayHint, getMeta, getValue, hashCode, hide, isPoison, setValue, toString, toString, withDisplayHint, withMeta
-
Constructor Details
-
KnowSureThingRTIndicator
public KnowSureThingRTIndicator() -
KnowSureThingRTIndicator
public KnowSureThingRTIndicator(int[] rocPeriods, int[] smaPeriods, double[] weights, int signalPeriod)
-
-
Method Details
-
getSignal
public double getSignal()Returns the current signal line value (SMA of KST).- Returns:
- the signal value
-
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
-