Class KlineSnapshots

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

public final class KlineSnapshots extends Object
Scalar-update helpers for a KlineValueSource against a MarketSnapshot, mirroring TickerSnapshots for the kline path. Extracts a single field and feeds it into a scalar RTIndicator.

OHLCV fields read the MarketSnapshot accessors directly. NumberOfTrades is kline-only: on any non-KlineSnapshot it resolves 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, KlineValueSource klineValueSource)
      Extracts the field selected by klineValueSource from the snapshot and pushes it into the indicator. Skips when the field is non-finite (Double.NaN or ±Infinity): a kline-only field on a non-kline snapshot resolves to NaN, 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, KlineValueSource klineValueSource)
      Reads a single primitive double from the snapshot via the source selector.