Class TickerRTIndicator
- All Implemented Interfaces:
ClockAware, Resettable, CacheableRTIndicator, RichRTIndicator<MarketSnapshot>, RTIndicator
- Direct Known Subclasses:
CompoundTickerRTIndicator
MarketSnapshot via a configurable
MarketSnapshotValueSource. Snapshot-agnostic: works on both the ticker and the kline path.
Extraction routes by source kind to the matching switch-based extractor
(TickerSnapshots for TickerValueSource, KlineSnapshots for
KlineValueSource); a source field absent on the incoming snapshot resolves to
Double.NaN and the update is skipped. Supports backtest mode where the snapshot's
timestamp is used to set a fixed clock for time-aware child indicators.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTickerRTIndicator(@NonNull MarketSnapshotValueSource valueSource, RTIndicator indicator) TickerRTIndicator(MarketSnapshotValueSource valueSource) -
Method Summary
Modifier and TypeMethodDescriptionbacktestEnabled(boolean backtestEnabled) booleanWhich snapshot field is extracted, the decorated chain below it, and whether backtest mode is on .doubleupdateFrom(@NonNull MarketSnapshot snap) Updates the indicator from a full market snapshot.Methods inherited from class AbstractDecorableIncrementalRTIndicator
getIndicator, nextValue, reset, setClockSupplier, updateMethods inherited from class AbstractIncrementalRTIndicator
getLastUpdateValue, getPeriodCycles, getPeriods, getPrevValue, initValue, isPeriodic, isReady, prevNextValue, setPeriods, tickValueMethods inherited from class AbstractRTIndicator
equals, getDisplayHint, getMeta, getValue, hashCode, hide, isPoison, setValue, toString, toString, withDisplayHint, withMetaMethods inherited from interface Resettable
resetMethods inherited from interface RichRTIndicator
requiresBarData
-
Constructor Details
-
TickerRTIndicator
protected TickerRTIndicator() -
TickerRTIndicator
-
TickerRTIndicator
public TickerRTIndicator(@NonNull @NonNull MarketSnapshotValueSource valueSource, RTIndicator indicator)
-
-
Method Details
-
backtestEnabled
-
signature
Which snapshot field is extracted, the decorated chain below it, and whether backtest mode is on .The highest-value identity in the base catalog, because
AbstractTickerStrategyregisters four of these by default — so without it every ticker strategy starts with four indicators that cannot be memoized before its author declares anything.backtestEnabledis part of the identity and not an execution detail: it decides whether a fixed clock built from the snapshot's own timestamp is installed on time-aware children, so the same source and the same chain produce different series with it on and off.The source is qualified by its enum type, not just its name.
MarketSnapshotValueSourceis a sealed interface over two independent enums that share six constant names —Open,High,Low,Close,Volume,VolumeQuote— andupdateFrom(MarketSnapshot)routes each to a different extractor. They happen to read the same fields today, but they are free to diverge (onlyTickerValueSourcehas theAutoAskClosefallback, onlyKlineValueSourcehasNumberOfTrades), and an unqualified"Close"would share one series between two extractions the moment they do.- Specified by:
signaturein interfaceCacheableRTIndicator- Returns:
- the identity, or
nullwhen this instance cannot state one (an unidentifiable source, a mode the implementation does not model) and must therefore compute live
-
updateFrom
Description copied from interface:RichRTIndicatorUpdates the indicator from a full market snapshot. Returns the new value so callers can chain (matchingRTIndicator.update(double)'s contract).- Specified by:
updateFromin interfaceRichRTIndicator<MarketSnapshot>
-
isBacktestEnabled
public boolean isBacktestEnabled()
-