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
Base RT indicator class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanHow this indicator's value should be presented — the typed view of theIndicatorMeta.DISPLAYmetadata entry.getMeta()The descriptive metadata this indicator carries about itself — canonical type id, parameters, display hint — kept separate from its registered name.doublegetValue()inthashCode()hide()Marks this an internal indicator — updated but not emitted.protected static booleanisPoison(double value) Returnstrueifvalueis non-finite (NaN or ±Infinity) — a value that must never be folded into a rolling accumulator.voidreset()protected doublesetValue(double value) toString()protected com.google.common.base.MoreObjects.ToStringHelpertoString(com.google.common.base.MoreObjects.ToStringHelper ts) doubleupdate(double newValue) withDisplayHint(DisplayHint displayHint) Sets how this indicator's value is presented — sugar over theIndicatorMeta.DISPLAYmetadata entry.Sets one descriptive metadata entry.
-
Constructor Details
-
AbstractRTIndicator
public AbstractRTIndicator()
-
-
Method Details
-
getValue
public double getValue()- Specified by:
getValuein interfaceRTIndicator
-
getMeta
Description copied from interface:RTIndicatorThe 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:
getMetain interfaceRTIndicator- Returns:
- the metadata, never
null;IndicatorMeta.EMPTYwhen none was set
-
getDisplayHint
Description copied from interface:RTIndicatorHow this indicator's value should be presented — the typed view of theIndicatorMeta.DISPLAYmetadata entry. Defaults toDisplayHint.ABSOLUTE; the fluent builder setsDisplayHint.PERCENTon the indicators that used to carry a"%"name suffix. Read by the charting/serialization layer instead of parsing the name.- Specified by:
getDisplayHintin interfaceRTIndicator- Returns:
- the display hint, never
null
-
withMeta
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 (anIndicatorMetaframe key, or a natural parameter name)value- the value, stored in string form- Returns:
- this indicator
-
withDisplayHint
Sets how this indicator's value is presented — sugar over theIndicatorMeta.DISPLAYmetadata entry.- Parameters:
displayHint- the display hint;nullorDisplayHint.ABSOLUTEclears it- Returns:
- this indicator
-
hide
Marks this an internal indicator — updated but not emitted. Sugar over theIndicatorMeta.VISIBILITYentry; the registration path sets it from the"_"name namespace so the emission boundary readsRTIndicator.isHidden()instead of the name.- Returns:
- this indicator
-
reset
public void reset()- Specified by:
resetin interfaceResettable
-
update
public double update(double newValue) - Specified by:
updatein interfaceRTIndicator
-
equals
-
hashCode
-
toString
-
setValue
protected double setValue(double value) -
isPoison
protected static boolean isPoison(double value) Returnstrueifvalueis 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 untilreset()— 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)
-