Interface CacheableRTIndicator
- All Superinterfaces:
Resettable, RTIndicator
- All Known Implementing Classes:
AcceleratorOscillatorRTIndicator, AdlRTIndicator, AdxRTIndicator, AroonRTIndicator, AtrRTIndicator, AwesomeOscillatorRTIndicator, BalanceOfPowerRTIndicator, BullBearPowerRTIndicator, ChaikinOscillatorRTIndicator, ChandeKrollStopRTIndicator, ChandelierExitRTIndicator, ChoppinessIndexRTIndicator, CmfRTIndicator, CompoundTickerRTIndicator, DonchianChannelRTIndicator, EaseOfMovementRTIndicator, ElderForceIndexRTIndicator, EmaRTIndicator, IchimokuRTIndicator, KeltnerChannelRTIndicator, KlingerOscillatorRTIndicator, MassIndexRTIndicator, MfiRTIndicator, MmaRTIndicator, NatrRTIndicator, NegativeVolumeIndexRTIndicator, ObvRTIndicator, ParabolicSarRTIndicator, PvtRTIndicator, RelativeVigorIndexRTIndicator, RsiRTIndicator, SmaRTIndicator, SmmaRTIndicator, StochasticOscillatorRTIndicator, SuperTrendRTIndicator, TickerRTIndicator, UltimateOscillatorRTIndicator, VortexRTIndicator, VwapRTIndicator, WilliamsRRTIndicator
The contract is deliberately narrow and opt-in. An indicator that does not implement this interface computes live and poisons its downstream chain — always correct, merely unmemoized — so partial coverage of the catalog is the design rather than a shortfall.
What a signature has to capture
Everything that can change the value series for a given input stream, taken from the
instance and never from the name it was registered under. The registration name is not an
identity: a swept property changes the instance while the name stays constant, so a name-derived
key would hand ema(12) the series recorded for ema(10). That includes:
- every field that enters the arithmetic — periods, smoothing factors, mode flags set after
construction such as
SmaRTIndicator.withDiscreteMode; - the signature of the source indicator it decorates, recursively, via
sourceTag(RTIndicator). A source that cannot state its own identity makes this indicator unidentifiable too, which is whysourceTagreturnsnullfor it.
A signature that forgets one of those is not caught by the type system. It is caught by the mandatory golden run the sweep layer performs — one vector executed twice, live and replayed, with the trade lists compared — which disables the memoization for the rest of the sweep when they differ. That guard is the only thing standing between a forgotten field and a silently wrong leaderboard.
The signature is read once, when the indicator is registered. Reconfiguring an indicator after registration would leave a stale identity behind; register it configured.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringleafSignature(RTIndicator self, Class<?> exactClass, String params) The identity of an indicator that reads the raw stream rather than decorating another one, which is the shape of the whole OHLCV suite.This instance's math identity — equal signatures must mean identical value series for identical input.signatureOf(RTIndicator indicator) The signature of an indicator reference, seeing through a read-only view.static StringsourceTag(RTIndicator source) The source-chain fragment to append to a decorating indicator's own signature.Methods inherited from interface Resettable
reset
-
Method Details
-
signature
String signature()This instance's math identity — equal signatures must mean identical value series for identical input.- 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
-
signatureOf
The signature of an indicator reference, seeing through a read-only view.Views are what
getReadOnlyExistinghands to every derived indicator, so without the unwrap no decorated indicator would ever be identifiable.- Parameters:
indicator- the reference to identify, may benull- Returns:
- its signature, or empty when it has none
-
sourceTag
The source-chain fragment to append to a decorating indicator's own signature.Three outcomes, and the middle one is the point: no source at all is identifiable (the empty string), an identifiable source contributes its signature, and an unidentifiable source makes the whole chain unidentifiable —
null, which the caller returns as its own signature to opt out.- Parameters:
source- the decorated indicator, ornullwhen this indicator reads the raw stream- Returns:
- the fragment to append, or
nullwhen the source cannot be identified
-
leafSignature
The identity of an indicator that reads the raw stream rather than decorating another one, which is the shape of the whole OHLCV suite.It exists to make the two mistakes of hand-writing a few dozen near-identical identities harmless. The class-exact check lives here, so an implementation cannot forget it. And the name is derived rather than written, so the copy-paste that would otherwise be the dangerous one — carrying a neighbour's literal prefix into a class whose arithmetic differs — cannot happen. Copying a whole body instead leaves the neighbour's class literal in place, and the class-exact check turns that into a denial: slower, never wrong.
The name is the class's own, minus the package root every indicator shares and minus the
RTIndicatorsuffix, which makes it unique by the same rule that makes class names unique. A bare simple name would not be: three names already exist in both the base and the pro catalog with different arithmetic behind them.- Parameters:
self- the indicator stating its identity, alwaysthisexactClass- the class that owns this identity, always a class literal of the callerparams- everything entering the arithmetic, in thek=v,k=vform the base catalog uses; empty for an indicator with no parameters at all- Returns:
- the identity, or
nullwhenselfis a subclass and so must state its own
-