Class MinRTIndicator

All Implemented Interfaces:
ClockAware, Resettable, RTIndicator

public class MinRTIndicator extends AbstractDecorableIncrementalRTIndicator
Min value RT Indicator. With periods == 0 tracks the all-time minimum; with periods > 0 tracks the rolling minimum over the last periods inputs, evicting values that scroll out of the window.
  • Constructor Details

    • MinRTIndicator

      public MinRTIndicator()
    • MinRTIndicator

      public MinRTIndicator(int periods)
    • MinRTIndicator

      public MinRTIndicator(RTIndicator indicator)
    • MinRTIndicator

      public MinRTIndicator(int periods, RTIndicator indicator)
  • Method Details

    • reset

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

      protected double tickValue(int tick, boolean init, boolean endPeriod, double newValue)
      Windowed mode (periods > 0), called on every tick including the first: nextValue alone can't maintain the window because the framework routes the very first update through AbstractIncrementalRTIndicator.initValue(double) instead, so the window is seeded here.
      Overrides:
      tickValue in class AbstractIncrementalRTIndicator
      Parameters:
      tick - current tick index within the period (1-based)
      init - true only on the very first update of this indicator
      endPeriod - true when this tick completes the current period
      newValue - the new input value
      Returns:
      the computed value for this tick
    • nextValue

      protected double nextValue(double prevValue, double newValue)
      Non-windowed mode (periods == 0): all-time running minimum.
      Overrides:
      nextValue in class AbstractDecorableIncrementalRTIndicator
      Parameters:
      prevValue - the previous indicator value (or last update value, depending on override)
      newValue - the new input value
      Returns:
      the computed indicator value