Class TickerSnapshots

java.lang.Object
com.wualabs.qtsurfer.engine.indicators.helpers.TickerSnapshots

public final class TickerSnapshots extends Object
Scalar-update helpers for a TickerValueSource against a MarketSnapshot. Extracts a single field and feeds it into a scalar RTIndicator.

Common OHLCV fields read the MarketSnapshot accessors directly (valid on both ticker and kline). Ticker-only fields (bid/ask/vwap/percentChange) are present only on a TickerSnapshot; on any other snapshot they resolve to Double.NaN and the update is skipped. Extraction is a switch (tableswitch) — no virtual dispatch on the hot path.

  • Method Details

    • update

      public static void update(RTIndicator indicator, MarketSnapshot snap, TickerValueSource tickerValueSource)
      Extracts the field selected by tickerValueSource from the snapshot and pushes it into the indicator. Skips when the field is non-finite (Double.NaN or ±Infinity): a missing ticker-only field resolves to NaN by design, and a corrupt feed value may be ±Infinity — neither must reach a rolling accumulator, where a single non-finite tick poisons it permanently.
    • getValue

      public static double getValue(MarketSnapshot snap, TickerValueSource tickerValueSource)
      Reads a single primitive double from the snapshot via the source selector.