Class InstrumentMapTickerSourceRTIndicator
java.lang.Object
com.wualabs.qtsurfer.engine.indicators.core.AbstractRTIndicator
com.wualabs.qtsurfer.engine.indicators.helpers.group.InstrumentMapRTIndicator
com.wualabs.qtsurfer.engine.indicators.helpers.group.InstrumentMapTickerSourceRTIndicator
- All Implemented Interfaces:
Backtestable, ClockAware, Resettable, RTIndicator, RTIndicatorSource<Ticker>
public class InstrumentMapTickerSourceRTIndicator
extends InstrumentMapRTIndicator
implements RTIndicatorSource<Ticker>
A map of RTIndicators for an instrument
-
Nested Class Summary
Nested classes/interfaces inherited from class InstrumentMapRTIndicator
InstrumentMapRTIndicator.IndicatorNotFoundException -
Field Summary
Fields inherited from class InstrumentMapRTIndicator
PRIVATE_PREFIX -
Constructor Summary
ConstructorsConstructorDescriptionInstrumentMapTickerSourceRTIndicator(@NonNull Instrument instrument, @NonNull TickerValueSource valueSource) InstrumentMapTickerSourceRTIndicator(Instrument instrument) -
Method Summary
Modifier and TypeMethodDescriptionbacktestEnabled(boolean backtestEnabled) protected StringWhich field of the incoming data this map extracts for scalar indicators, as a stable string.booleaninthashCode()booleanvoidsetBacktestEnabled(boolean backtestEnabled) voidupdateFrom(Ticker source) Propagates a ticker update to all registered indicators and to this map itself.Methods inherited from class InstrumentMapRTIndicator
add, clear, forEachPublicable, get, getCacheContext, getExisting, getInstrument, getNotices, getRaw, getReadOnly, getReadOnlyExisting, getValue, indicators, namedIndicators, raiseNotice, remove, reset, setClockSupplier, size, toStringMethods inherited from class AbstractRTIndicator
getDisplayHint, getMeta, getValue, hide, isPoison, setValue, toString, update, withDisplayHint, withMeta
-
Constructor Details
-
InstrumentMapTickerSourceRTIndicator
-
InstrumentMapTickerSourceRTIndicator
public InstrumentMapTickerSourceRTIndicator(@NonNull @NonNull Instrument instrument, @NonNull @NonNull TickerValueSource valueSource)
-
-
Method Details
-
backtestEnabled
-
cacheSelector
Description copied from class:InstrumentMapRTIndicatorWhich field of the incoming data this map extracts for scalar indicators, as a stable string.Abstract rather than defaulted on purpose: a subclass that reads a different field and forgot to say so would share memoized series between streams that never produced the same numbers, and a compile error is a far better way to find that out than a wrong leaderboard.
- Specified by:
cacheSelectorin classInstrumentMapRTIndicator- Returns:
- the selector name, never null
-
updateFrom
Propagates a ticker update to all registered indicators and to this map itself. In backtest mode, the ticker's timestamp is used to set a fixed clock on all clock-aware indicators before the update. Each child indicator is updated viaRichRTIndicator.updateFrom(T)if it implements that interface, otherwise viaTickerSnapshots.update(RTIndicator, MarketSnapshot, TickerValueSource)which extracts the configured value source field.- Specified by:
updateFromin interfaceRTIndicatorSource<Ticker>- Parameters:
source- the ticker data to propagate
-
hashCode
public int hashCode()- Overrides:
hashCodein classInstrumentMapRTIndicator
-
equals
- Overrides:
equalsin classInstrumentMapRTIndicator
-
getValueSource
-
isBacktestEnabled
public boolean isBacktestEnabled()- Specified by:
isBacktestEnabledin interfaceBacktestable
-
setBacktestEnabled
public void setBacktestEnabled(boolean backtestEnabled) - Specified by:
setBacktestEnabledin interfaceBacktestable
-