Class AbstractRTIndicator

java.lang.Object
com.wualabs.qtsurfer.engine.indicators.core.AbstractRTIndicator
All Implemented Interfaces:
Resettable, RTIndicator
Direct Known Subclasses:
AbstractDecorableRTIndicator, AbstractIncrementalRTIndicator, AbstractWindowSeriesRTIndicator, AcceleratorOscillatorRTIndicator, AdaptiveFisherTransformRTIndicator, AdlRTIndicator, AdxRTIndicator, AlmaRTIndicator, AroonRTIndicator, AtrRTIndicator, AutocorrelationRTIndicator, AwesomeOscillatorRTIndicator, BalanceOfPowerRTIndicator, BetaRTIndicator, BiFunctionRTIndicator, BollingerBandsRTIndicator, BollingerPercentBRTIndicator, BullBearPowerRTIndicator, CalmarRatioRTIndicator, ChaikinOscillatorRTIndicator, ChandeForecastOscillatorRTIndicator, ChandeKrollStopRTIndicator, ChandelierExitRTIndicator, ChoppinessIndexRTIndicator, CmfRTIndicator, CmoRTIndicator, CompoundRTIndicator, ConnorsRsiRTIndicator, ConstantRTIndicator, CoppockCurveRTIndicator, CorrelationRTIndicator, CovarianceRTIndicator, DemaRTIndicator, DetrendedPriceOscillatorRTIndicator, DistanceFromMaRTIndicator, DistanceRTIndicator, DonchianChannelRTIndicator, EaseOfMovementRTIndicator, EfficiencyRatioRTIndicator, ElderForceIndexRTIndicator, EnvelopesRTIndicator, EwmaVolatilityRTIndicator, FisherTransformRTIndicator, FramaRTIndicator, HmaRTIndicator, IchimokuRTIndicator, InstrumentGroupRTIndicator, InstrumentMapRTIndicator, KamaRTIndicator, KeltnerChannelRTIndicator, KlingerOscillatorRTIndicator, KnowSureThingRTIndicator, LeastSquaresMovingAverageRTIndicator, MassIndexRTIndicator, MaxDrawdownRTIndicator, McGinleyDynamicRTIndicator, MfiRTIndicator, MomentumRTIndicator, NatrRTIndicator, NegativeVolumeIndexRTIndicator, ObvRTIndicator, OmegaRatioRTIndicator, ParabolicSarRTIndicator, PvtRTIndicator, ReadOnlyRTIndicator, RelativeVigorIndexRTIndicator, RelativeVolatilityIndexRTIndicator, RocRTIndicator, RollingPercentileRTIndicator, SortinoRatioRTIndicator, StandardDeviationRTIndicator, StandardDeviationRTIndicator, StochasticOscillatorRTIndicator, SuperTrendRTIndicator, TailRatioRTIndicator, TemaRTIndicator, TreynorRatioRTIndicator, TrixRTIndicator, TrueStrengthIndexRTIndicator, UlcerIndexRTIndicator, UltimateOscillatorRTIndicator, ValueRTIndicator, VolatilityRTIndicator, VortexRTIndicator, VwapRTIndicator, WilliamsRRTIndicator, YangZhangVolatilityRTIndicator, ZScoreRTIndicator

public abstract class AbstractRTIndicator extends Object implements RTIndicator
Base RT indicator class
  • Constructor Details

    • AbstractRTIndicator

      public AbstractRTIndicator()
  • Method Details

    • getValue

      public double getValue()
      Specified by:
      getValue in interface RTIndicator
    • 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
      Returns:
      the metadata, never null; IndicatorMeta.EMPTY when none was set
    • getDisplayHint

      public DisplayHint getDisplayHint()
      Description copied from interface: RTIndicator
      How this indicator's value should be presented — the typed view of the IndicatorMeta.DISPLAY metadata entry. Defaults to DisplayHint.ABSOLUTE; the fluent builder sets DisplayHint.PERCENT on the indicators that used to carry a "%" name suffix. Read by the charting/serialization layer instead of parsing the name.
      Specified by:
      getDisplayHint in interface RTIndicator
      Returns:
      the display hint, never null
    • withMeta

      public AbstractRTIndicator withMeta(String key, Object value)
      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.
      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)
      Sets how this indicator's value is presented — sugar over the IndicatorMeta.DISPLAY metadata entry.
      Parameters:
      displayHint - the display hint; null or DisplayHint.ABSOLUTE clears it
      Returns:
      this indicator
    • hide

      public AbstractRTIndicator hide()
      Marks this an internal indicator — updated but not emitted. Sugar over the IndicatorMeta.VISIBILITY entry; the registration path sets it from the "_" name namespace so the emission boundary reads RTIndicator.isHidden() instead of the name.
      Returns:
      this indicator
    • reset

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

      public double update(double newValue)
      Specified by:
      update in interface RTIndicator
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setValue

      protected double setValue(double value)
    • isPoison

      protected static boolean isPoison(double value)
      Returns true if value is non-finite (NaN or ±Infinity) — a value that must never be folded into a rolling accumulator.

      Under IEEE-754 arithmetic NaN and ±Infinity are absorbing under + - * /, so a single non-finite tick folded into a running sum, variance, EMA or sorted window permanently corrupts it until reset() — the poison outlives the bad tick's presence in any rolling window. Guard raw inputs (or per-tick derived values such as a log-return) with this and hold the previous output (getValue()) instead of accumulating.

    • toString

      protected com.google.common.base.MoreObjects.ToStringHelper toString(com.google.common.base.MoreObjects.ToStringHelper ts)