Class StochasticRsiRTIndicator
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.StochasticRsiRTIndicator
- All Implemented Interfaces:
ClockAware, Resettable, RTIndicator
Stochastic RSI RTIndicator
-
Constructor Summary
ConstructorsConstructorDescriptionStochasticRsiRTIndicator(int periods) StochasticRsiRTIndicator(int periods, RTIndicator indicator) StochasticRsiRTIndicator(int periods, RTIndicator indicator, boolean sma) StochasticRsiRTIndicator(int periods, RsiRTIndicator rsi) -
Method Summary
Modifier and TypeMethodDescriptionprotected doublenextValue(double prevValue, double newValue) Computes the Stochastic RSI using the formula: StochRSI = 100 * (RSI - minRSI) / (maxRSI - minRSI).voidreset()protected com.google.common.base.MoreObjects.ToStringHelpertoString(com.google.common.base.MoreObjects.ToStringHelper ts) Methods inherited from class AbstractDecorableIncrementalRTIndicator
getIndicator, setClockSupplier, updateMethods 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, withDisplayHint, withMeta
-
Constructor Details
-
StochasticRsiRTIndicator
public StochasticRsiRTIndicator(int periods) -
StochasticRsiRTIndicator
-
StochasticRsiRTIndicator
-
StochasticRsiRTIndicator
-
-
Method Details
-
reset
public void reset()- Specified by:
resetin interfaceResettable- Overrides:
resetin classAbstractDecorableIncrementalRTIndicator
-
nextValue
protected double nextValue(double prevValue, double newValue) Computes the Stochastic RSI using the formula: StochRSI = 100 * (RSI - minRSI) / (maxRSI - minRSI).newValueis already the freshly-computed RSI for this tick — the decorated chain (AbstractDecorableIncrementalRTIndicator.update(double)) runs the wrapped RSI indicator before this method is ever reached, so readinggetValue()instead would read this indicator's own previous StochRSI output, not RSI (finding T3.3). Tracks rolling max/min RSI over the configured period. Returns 0 when the numerator or denominator is zero (flat RSI range).- Overrides:
nextValuein classAbstractDecorableIncrementalRTIndicator- Parameters:
prevValue- unusednewValue- the RSI value for this tick- Returns:
- StochRSI value in the range [0, 100]
-
toString
protected com.google.common.base.MoreObjects.ToStringHelper toString(com.google.common.base.MoreObjects.ToStringHelper ts) - Overrides:
toStringin classAbstractRTIndicator
-