Class ReadOnlyRTIndicator
- All Implemented Interfaces:
Resettable, RTIndicator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetId()This indicator's canonical type id — the strategy-IR catalog vocabulary (rsi,bollinger, …), theidof its stored-column metadata.getMeta()The descriptive metadata this indicator carries about itself — canonical type id, parameters, display hint — kept separate from its registered name.doublegetValue()booleanisReady()Returns whether this indicator has received enough data to produce meaningful values.doubleupdate(double newValue) withDisplayHint(DisplayHint displayHint) Sets how this indicator's value is presented — sugar over theIndicatorMeta.DISPLAYmetadata entry.Sets one descriptive metadata entry.Methods inherited from class AbstractRTIndicator
equals, getDisplayHint, hashCode, hide, isPoison, reset, setValue, toString, toStringMethods inherited from interface RTIndicator
isHidden, ro, update, update
-
Constructor Details
-
ReadOnlyRTIndicator
-
-
Method Details
-
isReady
public boolean isReady()Description copied from interface:RTIndicatorReturns 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 returnstrue, the indicator's output is statistically valid.The default implementation returns
truefor 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:
trueif the indicator has completed its warmup period
-
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- Overrides:
getMetain classAbstractRTIndicator- Returns:
- the metadata, never
null;IndicatorMeta.EMPTYwhen none was set
-
getId
Description copied from interface:RTIndicatorThis indicator's canonical type id — the strategy-IR catalog vocabulary (rsi,bollinger, …), theidof its stored-column metadata.Defaults to the class name with its
RTIndicatorsuffix 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 explicitIndicatorMeta.IDentry, which wins.- Returns:
- the canonical id, never
null
-
withMeta
Description copied from class:AbstractRTIndicatorSets 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:
withMetain classAbstractRTIndicator- Parameters:
key- the entry key (anIndicatorMetaframe key, or a natural parameter name)value- the value, stored in string form- Returns:
- this indicator
-
withDisplayHint
Description copied from class:AbstractRTIndicatorSets how this indicator's value is presented — sugar over theIndicatorMeta.DISPLAYmetadata entry.- Overrides:
withDisplayHintin classAbstractRTIndicator- Parameters:
displayHint- the display hint;nullorDisplayHint.ABSOLUTEclears it- Returns:
- this indicator
-
getValue
public double getValue()- Specified by:
getValuein interfaceRTIndicator- Overrides:
getValuein classAbstractRTIndicator
-
update
public double update(double newValue) - Specified by:
updatein interfaceRTIndicator- Overrides:
updatein classAbstractRTIndicator
-
getIndicator
-