Class StochasticRsiRTIndicator

All Implemented Interfaces:
ClockAware, Resettable, RTIndicator

public class StochasticRsiRTIndicator extends AbstractDecorableIncrementalRTIndicator
Stochastic RSI RTIndicator
  • Constructor Details

    • StochasticRsiRTIndicator

      public StochasticRsiRTIndicator(int periods)
    • StochasticRsiRTIndicator

      public StochasticRsiRTIndicator(int periods, RTIndicator indicator)
    • StochasticRsiRTIndicator

      public StochasticRsiRTIndicator(int periods, RTIndicator indicator, boolean sma)
    • StochasticRsiRTIndicator

      public StochasticRsiRTIndicator(int periods, RsiRTIndicator rsi)
  • Method Details

    • reset

      public void reset()
      Specified by:
      reset in interface Resettable
      Overrides:
      reset in class AbstractDecorableIncrementalRTIndicator
    • nextValue

      protected double nextValue(double prevValue, double newValue)
      Computes the Stochastic RSI using the formula: StochRSI = 100 * (RSI - minRSI) / (maxRSI - minRSI). newValue is 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 reading getValue() 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:
      nextValue in class AbstractDecorableIncrementalRTIndicator
      Parameters:
      prevValue - unused
      newValue - 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:
      toString in class AbstractRTIndicator