Record Class KlineSnapshot
java.lang.Object
java.lang.Record
com.wualabs.qtsurfer.engine.core.KlineSnapshot
- All Implemented Interfaces:
MarketSnapshot
public record KlineSnapshot(Instrument instrument, KlineInterval interval, long openTime, double open, double high, double low, double close, double volume, double quoteVolume, long closeTime, long numberOfTrades, boolean closed)
extends Record
implements MarketSnapshot
Primitive-double view of a
Kline. timestamp() returns the bar's close time so
indicators consuming snapshots see a uniform "as-of" timeline regardless of whether the source
is a tick stream or a kline stream.
Null BigDecimal fields on the source map to Double.NaN.
-
Constructor Summary
ConstructorsConstructorDescriptionKlineSnapshot(Instrument instrument, KlineInterval interval, long openTime, double open, double high, double low, double close, double volume, double quoteVolume, long closeTime, long numberOfTrades, boolean closed) Creates an instance of aKlineSnapshotrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleclose()Returns the value of thecloserecord component.booleanclosed()Returns the value of theclosedrecord component.longReturns the value of thecloseTimerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doublehigh()Returns the value of thehighrecord component.Returns the value of theinstrumentrecord component.interval()Returns the value of theintervalrecord component.doublelow()Returns the value of thelowrecord component.longReturns the value of thenumberOfTradesrecord component.static KlineSnapshotdoubleopen()Returns the value of theopenrecord component.longopenTime()Returns the value of theopenTimerecord component.doubleReturns the value of thequoteVolumerecord component.longObservation timestamp, epoch milliseconds.final StringtoString()Returns a string representation of this record class.doublevolume()Returns the value of thevolumerecord component.
-
Constructor Details
-
KlineSnapshot
public KlineSnapshot(Instrument instrument, KlineInterval interval, long openTime, double open, double high, double low, double close, double volume, double quoteVolume, long closeTime, long numberOfTrades, boolean closed) Creates an instance of aKlineSnapshotrecord class.- Parameters:
instrument- the value for theinstrumentrecord componentinterval- the value for theintervalrecord componentopenTime- the value for theopenTimerecord componentopen- the value for theopenrecord componenthigh- the value for thehighrecord componentlow- the value for thelowrecord componentclose- the value for thecloserecord componentvolume- the value for thevolumerecord componentquoteVolume- the value for thequoteVolumerecord componentcloseTime- the value for thecloseTimerecord componentnumberOfTrades- the value for thenumberOfTradesrecord componentclosed- the value for theclosedrecord component
-
-
Method Details
-
timestamp
public long timestamp()Description copied from interface:MarketSnapshotObservation timestamp, epoch milliseconds.The backend NATS/QuestDB pipeline uses microseconds; the engine has historically operated in milliseconds (XChange Ticker, Kline, signals). Cross-pipeline integration with micro-resolution data is a separate refactor — a
timestampMicros()method can be added additively without breaking existing snapshots.- Specified by:
timestampin interfaceMarketSnapshot
-
of
-
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.- Specified by:
instrumentin interfaceMarketSnapshot- Returns:
- the value of the
instrumentrecord component
-
interval
Returns the value of theintervalrecord component.- Returns:
- the value of the
intervalrecord component
-
openTime
public long openTime()Returns the value of theopenTimerecord component.- Returns:
- the value of the
openTimerecord component
-
open
public double open()Returns the value of theopenrecord component.- Specified by:
openin interfaceMarketSnapshot- Returns:
- the value of the
openrecord component
-
high
public double high()Returns the value of thehighrecord component.- Specified by:
highin interfaceMarketSnapshot- Returns:
- the value of the
highrecord component
-
low
public double low()Returns the value of thelowrecord component.- Specified by:
lowin interfaceMarketSnapshot- Returns:
- the value of the
lowrecord component
-
close
public double close()Returns the value of thecloserecord component.- Specified by:
closein interfaceMarketSnapshot- Returns:
- the value of the
closerecord component
-
volume
public double volume()Returns the value of thevolumerecord component.- Specified by:
volumein interfaceMarketSnapshot- Returns:
- the value of the
volumerecord component
-
quoteVolume
public double quoteVolume()Returns the value of thequoteVolumerecord component.- Specified by:
quoteVolumein interfaceMarketSnapshot- Returns:
- the value of the
quoteVolumerecord component
-
closeTime
public long closeTime()Returns the value of thecloseTimerecord component.- Returns:
- the value of the
closeTimerecord component
-
numberOfTrades
public long numberOfTrades()Returns the value of thenumberOfTradesrecord component.- Returns:
- the value of the
numberOfTradesrecord component
-
closed
public boolean closed()Returns the value of theclosedrecord component.- Returns:
- the value of the
closedrecord component
-