Record Class TickerSnapshot
- All Implemented Interfaces:
MarketSnapshot
Ticker. Created once per incoming tick, shared across all
indicators for that instrument, exposing OHLCV plus order-book and trade-stats data through the
sealed MarketSnapshot contract.
Null BigDecimal fields map to Double.NaN.
volume, high, low and open are 24-hour rolling exchange
statistics, not this tick's bar. They are whatever the exchange reports as the rolling
window's totals, so they barely move from tick to tick and repeat the same figure indefinitely.
Only close (the last trade), bid/ask and the order-book sizes are
instantaneous.
This matters because a RichRTIndicator<MarketSnapshot> written for bar data — OBV, ATR,
MFI, VWAP, … — accepts one of these without complaint and produces a plausible-looking,
meaningless series from the 24h aggregates. Indicators that need real bars declare
requiresBarData(), and the ticker dispatcher raises a retrievable notice when one is bound here
. The path that carries true per-bar OHLCV is KlineSnapshot,
driven by AbstractKlineStrategy.
-
Constructor Summary
ConstructorsConstructorDescriptionTickerSnapshot(Instrument instrument, double bid, double bidSize, double ask, double askSize, double open, double high, double low, double close, double vwap, double volume, double quoteVolume, double percentageChange, long timestamp) Creates an instance of aTickerSnapshotrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleask()Returns the value of theaskrecord component.doubleaskSize()Returns the value of theaskSizerecord component.doublebid()Returns the value of thebidrecord component.doublebidSize()Returns the value of thebidSizerecord component.doubleclose()Returns the value of thecloserecord 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.doublelow()Returns the value of thelowrecord component.static TickerSnapshotPrimitive view of the engine-owned canonicalTicker.doubleopen()Returns the value of theopenrecord component.doubleReturns the value of thepercentageChangerecord component.doubleReturns the value of thequoteVolumerecord component.longReturns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.doublevolume()Returns the value of thevolumerecord component.doublevwap()Returns the value of thevwaprecord component.
-
Constructor Details
-
TickerSnapshot
public TickerSnapshot(Instrument instrument, double bid, double bidSize, double ask, double askSize, double open, double high, double low, double close, double vwap, double volume, double quoteVolume, double percentageChange, long timestamp) Creates an instance of aTickerSnapshotrecord 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 componentclose- the value for thecloserecord 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
-
of
Primitive view of the engine-owned canonicalTicker. -
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
-
bid
public double bid()Returns the value of thebidrecord component.- Returns:
- the value of the
bidrecord component
-
bidSize
public double bidSize()Returns the value of thebidSizerecord component.- Returns:
- the value of the
bidSizerecord component
-
ask
public double ask()Returns the value of theaskrecord component.- Returns:
- the value of the
askrecord component
-
askSize
public double askSize()Returns the value of theaskSizerecord component.- Returns:
- the value of the
askSizerecord 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
-
vwap
public double vwap()Returns the value of thevwaprecord component.- Returns:
- the value of the
vwaprecord 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
-
percentageChange
public double percentageChange()Returns the value of thepercentageChangerecord component.- Returns:
- the value of the
percentageChangerecord component
-
timestamp
public long timestamp()Returns the value of thetimestamprecord component.- Specified by:
timestampin interfaceMarketSnapshot- Returns:
- the value of the
timestamprecord component
-