Class CompoundRTIndicator

java.lang.Object
com.wualabs.qtsurfer.engine.indicators.core.AbstractRTIndicator
com.wualabs.qtsurfer.engine.indicators.helpers.group.CompoundRTIndicator
All Implemented Interfaces:
ClockAware, Resettable, RTIndicator

public class CompoundRTIndicator extends AbstractRTIndicator implements ClockAware
Inmutable Compound RT Indicator
  • Constructor Details

    • CompoundRTIndicator

      public CompoundRTIndicator(int indexValue, @NonNull @NonNull RTIndicator... indicators)
    • CompoundRTIndicator

      public CompoundRTIndicator(@NonNull @NonNull List<RTIndicator> indicators)
    • CompoundRTIndicator

      public CompoundRTIndicator(int indexValue, @NonNull @NonNull List<RTIndicator> indicators)
  • Method Details

    • of

      public static CompoundRTIndicator of(@NonNull @NonNull Collection<RTIndicator> indicators)
    • of

      public static CompoundRTIndicator of(@NonNull @NonNull RTIndicator... indicators)
    • withIndexValue

      public CompoundRTIndicator withIndexValue(int indexValue)
    • getIndicator

      public <T extends RTIndicator> T getIndicator(int index)
    • setClockSupplier

      public void setClockSupplier(@NonNull @NonNull Supplier<Clock> clockSupplier)
      Specified by:
      setClockSupplier in interface ClockAware
    • reset

      public void reset()
      Specified by:
      reset in interface Resettable
      Overrides:
      reset in class AbstractRTIndicator
    • update

      public double update(double newValue)
      Fans out the input value to all child indicators, then returns the value from the indicator at indexValue position (if set), or falls back to the raw input value. This enables updating multiple indicators atomically while extracting the result from a specific one.
      Specified by:
      update in interface RTIndicator
      Overrides:
      update in class AbstractRTIndicator
      Parameters:
      newValue - the input value forwarded to all child indicators
      Returns:
      the value from the selected indicator, or the raw input