Interface RichRTIndicator<T extends MarketSnapshot>

Type Parameters:
T - snapshot shape this indicator consumes (TickerSnapshot or KlineSnapshot)
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, IchimokuRTIndicator, KeltnerChannelRTIndicator, KlingerOscillatorRTIndicator, MassIndexRTIndicator, MfiRTIndicator, NatrRTIndicator, NegativeVolumeIndexRTIndicator, ObvRTIndicator, ParabolicSarRTIndicator, PvtRTIndicator, RelativeVigorIndexRTIndicator, StochasticOscillatorRTIndicator, SuperTrendRTIndicator, TickerRTIndicator, UltimateOscillatorRTIndicator, VortexRTIndicator, VwapRTIndicator, WilliamsRRTIndicator

public interface RichRTIndicator<T extends MarketSnapshot> extends RTIndicator
Real-time indicator that consumes a full MarketSnapshot rather than a single scalar value. Use this when the indicator needs more than one field from the input — e.g. ATR (HLC), OBV (volume + close), VWAP (volume + price), microstructure indicators (bid/ask).

Scalar indicators (SMA, EMA, RSI, …) continue to extend RTIndicator and receive a single double via TickerValueSource-driven field extraction; nothing changes for them.

The wiring layer (InstrumentMapTickerSourceRTIndicator) builds the snapshot once per tick and dispatches it to every registered indicator that implements this interface, while scalar indicators receive the extracted field. Compile-time type-safety: the dispatcher pattern matches the snapshot type via the sealed MarketSnapshot hierarchy.

  • Method Details

    • updateFrom

      double updateFrom(@NonNull T snapshot)
      Updates the indicator from a full market snapshot. Returns the new value so callers can chain (matching RTIndicator.update(double)'s contract).
    • requiresBarData

      default boolean requiresBarData()
      Whether this indicator's result is only meaningful over per-bar OHLCV data.

      The distinction matters because a RichRTIndicator<MarketSnapshot> accepts a TickerSnapshot just as happily as a KlineSnapshot — and on the ticker path volume, high, low and open are the exchange's 24-hour rolling statistics, not this tick's bar. Nothing throws: OBV silently accumulates a 24h volume figure over and over, ATR reads a 24h range as if it were one bar's. The numbers look plausible and mean nothing, which is the worst failure mode of the three.

      Indicators that return true are flagged once per (indicator, instrument) when bound on the ticker path — see InstrumentMapTickerSourceRTIndicator. Scalar indicators (SMA/EMA/RSI over a single price) are unaffected and default to false.

      Returns:
      true if this indicator needs real bar data; false by default