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 Summary
ConstructorsConstructorDescriptionTicker(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 aTickerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionask()Returns the value of theaskrecord component.askSize()Returns the value of theaskSizerecord component.bid()Returns the value of thebidrecord component.bidSize()Returns the value of thebidSizerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.high()Returns the value of thehighrecord component.Returns the value of theinstrumentrecord component.last()Returns the value of thelastrecord component.low()Returns the value of thelowrecord component.open()Returns the value of theopenrecord component.Returns the value of thepercentageChangerecord component.Returns the value of thequoteVolumerecord component.longReturns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.volume()Returns the value of thevolumerecord component.vwap()Returns the value of thevwaprecord component.
-
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 aTickerrecord class.- Parameters:
instrument- the value for theinstrumentrecord componentbid- the value for thebidrecord componentbidSize- the value for thebidSizerecord componentask- the value for theaskrecord componentaskSize- the value for theaskSizerecord componentopen- the value for theopenrecord componenthigh- the value for thehighrecord componentlow- the value for thelowrecord componentlast- the value for thelastrecord componentvwap- the value for thevwaprecord componentvolume- the value for thevolumerecord componentquoteVolume- the value for thequoteVolumerecord componentpercentageChange- the value for thepercentageChangerecord componenttimestamp- the value for thetimestamprecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
instrument
Returns the value of theinstrumentrecord component.- Returns:
- the value of the
instrumentrecord component
-
bid
Returns the value of thebidrecord component.- Returns:
- the value of the
bidrecord component
-
bidSize
Returns the value of thebidSizerecord component.- Returns:
- the value of the
bidSizerecord component
-
ask
Returns the value of theaskrecord component.- Returns:
- the value of the
askrecord component
-
askSize
Returns the value of theaskSizerecord component.- Returns:
- the value of the
askSizerecord component
-
open
Returns the value of theopenrecord component.- Returns:
- the value of the
openrecord component
-
high
Returns the value of thehighrecord component.- Returns:
- the value of the
highrecord component
-
low
Returns the value of thelowrecord component.- Returns:
- the value of the
lowrecord component
-
last
Returns the value of thelastrecord component.- Returns:
- the value of the
lastrecord component
-
vwap
Returns the value of thevwaprecord component.- Returns:
- the value of the
vwaprecord component
-
volume
Returns the value of thevolumerecord component.- Returns:
- the value of the
volumerecord component
-
quoteVolume
Returns the value of thequoteVolumerecord component.- Returns:
- the value of the
quoteVolumerecord component
-
percentageChange
Returns the value of thepercentageChangerecord component.- Returns:
- the value of the
percentageChangerecord component
-
timestamp
public long timestamp()Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-