Record Class HistoricalLightweightMainAggregationEvent.Trades
java.lang.Object
java.lang.Record
velox.api.layer1.datastructure.events.dynamichistory.HistoricalLightweightMainAggregationEvent.Trades
- Record Components:
askSize- total size of the trades in this window whose aggressor was on the ask sidebidSize- total size of the trades in this window whose aggressor was on the bid sideaskPriceSize- sum ofprice * sizeover the ask-aggressor trades, i.e.Σᵢ askPriceᵢ * askSizeᵢ.bidPriceSize- sum ofprice * sizeover the bid-aggressor trades, i.e.Σᵢ bidPriceᵢ * bidSizeᵢ.e
- Enclosing class:
HistoricalLightweightMainAggregationEvent
public static record HistoricalLightweightMainAggregationEvent.Trades(long askSize, long bidSize, long askPriceSize, long bidPriceSize)
extends Record
Trades executed within the block's time window, aggregated by aggressor side.
Values are stored in raw (unconverted) units: sizes must be divided by InstrumentInfo.sizeMultiplier
to get the size as displayed to the user, and prices are expressed in pips, so they must be multiplied by
InstrumentInfo.pips to get the actual price.
The price-size sums exist so that aggregations can be merged by simple addition; divide one by the matching size to recover the volume-weighted average price of the side (still in pips).
-
Constructor Summary
ConstructorsConstructorDescriptionTrades(long askSize, long bidSize, long askPriceSize, long bidPriceSize) Creates an instance of aTradesrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of theaskPriceSizerecord component.longaskSize()Returns the value of theaskSizerecord component.longReturns the value of thebidPriceSizerecord component.longbidSize()Returns the value of thebidSizerecord component.final booleanIndicates whether some other object is "equal to" this one.doublelongfinal inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Trades
public Trades(long askSize, long bidSize, long askPriceSize, long bidPriceSize) Creates an instance of aTradesrecord class.- Parameters:
askSize- the value for theaskSizerecord componentbidSize- the value for thebidSizerecord componentaskPriceSize- the value for theaskPriceSizerecord componentbidPriceSize- the value for thebidPriceSizerecord component
-
-
Method Details
-
getAveragePrice
public double getAveragePrice() -
getTotalSize
public long getTotalSize() -
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. -
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. -
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. All components in this record class are compared with '=='. -
askSize
public long askSize()Returns the value of theaskSizerecord component.- Returns:
- the value of the
askSizerecord component
-
bidSize
public long bidSize()Returns the value of thebidSizerecord component.- Returns:
- the value of the
bidSizerecord component
-
askPriceSize
public long askPriceSize()Returns the value of theaskPriceSizerecord component.- Returns:
- the value of the
askPriceSizerecord component
-
bidPriceSize
public long bidPriceSize()Returns the value of thebidPriceSizerecord component.- Returns:
- the value of the
bidPriceSizerecord component
-