Record Class Ticker

java.lang.Object
java.lang.Record
com.wualabs.qtsurfer.engine.core.Ticker

public record Ticker(Instrument instrument, BigDecimal bid, BigDecimal bidSize, BigDecimal ask, BigDecimal askSize, BigDecimal open, BigDecimal high, BigDecimal low, BigDecimal last, BigDecimal vwap, BigDecimal volume, BigDecimal quoteVolume, BigDecimal percentageChange, long timestamp) extends Record
Engine-owned, exchange-agnostic ticker. Canonical precision model (BigDecimal) for a point-in-time market snapshot; the primitive-double TickerSnapshot is derived from it for the indicator hot path.

Pure domain record with no XChange dependency. Conversion to/from XChange DTOs lives in the exchange-adapter boundary (XChangeConvert in qtsurfer-engine-exchange), keeping XChange out of engine-core. Fields may be null when the source exchange does not report them.

  • Constructor Details

    • Ticker

      public Ticker(Instrument instrument, BigDecimal bid, BigDecimal bidSize, BigDecimal ask, BigDecimal askSize, BigDecimal open, BigDecimal high, BigDecimal low, BigDecimal last, BigDecimal vwap, BigDecimal volume, BigDecimal quoteVolume, BigDecimal percentageChange, long timestamp)
      Creates an instance of a Ticker record class.
      Parameters:
      instrument - the value for the instrument record component
      bid - the value for the bid record component
      bidSize - the value for the bidSize record component
      ask - the value for the ask record component
      askSize - the value for the askSize record component
      open - the value for the open record component
      high - the value for the high record component
      low - the value for the low record component
      last - the value for the last record component
      vwap - the value for the vwap record component
      volume - the value for the volume record component
      quoteVolume - the value for the quoteVolume record component
      percentageChange - the value for the percentageChange record component
      timestamp - the value for the timestamp record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • instrument

      public Instrument instrument()
      Returns the value of the instrument record component.
      Returns:
      the value of the instrument record component
    • bid

      public BigDecimal bid()
      Returns the value of the bid record component.
      Returns:
      the value of the bid record component
    • bidSize

      public BigDecimal bidSize()
      Returns the value of the bidSize record component.
      Returns:
      the value of the bidSize record component
    • ask

      public BigDecimal ask()
      Returns the value of the ask record component.
      Returns:
      the value of the ask record component
    • askSize

      public BigDecimal askSize()
      Returns the value of the askSize record component.
      Returns:
      the value of the askSize record component
    • open

      public BigDecimal open()
      Returns the value of the open record component.
      Returns:
      the value of the open record component
    • high

      public BigDecimal high()
      Returns the value of the high record component.
      Returns:
      the value of the high record component
    • low

      public BigDecimal low()
      Returns the value of the low record component.
      Returns:
      the value of the low record component
    • last

      public BigDecimal last()
      Returns the value of the last record component.
      Returns:
      the value of the last record component
    • vwap

      public BigDecimal vwap()
      Returns the value of the vwap record component.
      Returns:
      the value of the vwap record component
    • volume

      public BigDecimal volume()
      Returns the value of the volume record component.
      Returns:
      the value of the volume record component
    • quoteVolume

      public BigDecimal quoteVolume()
      Returns the value of the quoteVolume record component.
      Returns:
      the value of the quoteVolume record component
    • percentageChange

      public BigDecimal percentageChange()
      Returns the value of the percentageChange record component.
      Returns:
      the value of the percentageChange record component
    • timestamp

      public long timestamp()
      Returns the value of the timestamp record component.
      Returns:
      the value of the timestamp record component