Class ReadOnlyRTIndicator

java.lang.Object
com.wualabs.qtsurfer.engine.indicators.core.AbstractRTIndicator
com.wualabs.qtsurfer.engine.indicators.numeric.ReadOnlyRTIndicator
All Implemented Interfaces:
Resettable, RTIndicator

public final class ReadOnlyRTIndicator extends AbstractRTIndicator
Avoids update the wrapped RTIndicator
  • Constructor Details

    • ReadOnlyRTIndicator

      public ReadOnlyRTIndicator(@NonNull @NonNull RTIndicator indicator)
  • Method Details

    • isReady

      public boolean isReady()
      Description copied from interface: RTIndicator
      Returns 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 returns true, the indicator's output is statistically valid.

      The default implementation returns true for 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:
      true if the indicator has completed its warmup period
    • getMeta

      public IndicatorMeta getMeta()
      Description copied from interface: RTIndicator
      The descriptive metadata this indicator carries about itself — canonical type id, parameters, display hint — kept separate from its registered name. What used to be encoded in name prefixes/suffixes (rsi14%, blgr13_2Upper) rides here as key=value entries the serialization layer can attach per stored column.
      Specified by:
      getMeta in interface RTIndicator
      Overrides:
      getMeta in class AbstractRTIndicator
      Returns:
      the metadata, never null; IndicatorMeta.EMPTY when none was set
    • getId

      public String getId()
      Description copied from interface: RTIndicator
      This indicator's canonical type id — the strategy-IR catalog vocabulary (rsi, bollinger, …), the id of its stored-column metadata.

      Defaults to the class name with its RTIndicator suffix stripped and first letter lower-cased (IndicatorMeta.deriveId(Class)), so every indicator self-reports an id with no per-factory wiring. An indicator whose canonical id differs from that derivation — a renamed type, or one registered wrapped in a generic decorator — carries an explicit IndicatorMeta.ID entry, which wins.

      Returns:
      the canonical id, never null
    • withMeta

      public AbstractRTIndicator withMeta(String key, Object value)
      Description copied from class: AbstractRTIndicator
      Sets one descriptive metadata entry. Fluent so a builder factory can describe the indicator as it registers it, e.g. new RsiRTIndicator(periods, sma).withMeta(IndicatorMeta.ID, "rsi").withMeta("periods", periods). Metadata is a write-only descriptor — implementations must never read it back to drive a computation.
      Overrides:
      withMeta in class AbstractRTIndicator
      Parameters:
      key - the entry key (an IndicatorMeta frame key, or a natural parameter name)
      value - the value, stored in string form
      Returns:
      this indicator
    • withDisplayHint

      public AbstractRTIndicator withDisplayHint(DisplayHint displayHint)
      Description copied from class: AbstractRTIndicator
      Sets how this indicator's value is presented — sugar over the IndicatorMeta.DISPLAY metadata entry.
      Overrides:
      withDisplayHint in class AbstractRTIndicator
      Parameters:
      displayHint - the display hint; null or DisplayHint.ABSOLUTE clears it
      Returns:
      this indicator
    • getValue

      public double getValue()
      Specified by:
      getValue in interface RTIndicator
      Overrides:
      getValue in class AbstractRTIndicator
    • update

      public double update(double newValue)
      Specified by:
      update in interface RTIndicator
      Overrides:
      update in class AbstractRTIndicator
    • getIndicator

      public RTIndicator getIndicator()