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 side
bidSize - total size of the trades in this window whose aggressor was on the bid side
askPriceSize - sum of price * size over the ask-aggressor trades, i.e. Σᵢ askPriceᵢ * askSizeᵢ.
bidPriceSize - sum of price * size over 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 Details

    • Trades

      public Trades(long askSize, long bidSize, long askPriceSize, long bidPriceSize)
      Creates an instance of a Trades record class.
      Parameters:
      askSize - the value for the askSize record component
      bidSize - the value for the bidSize record component
      askPriceSize - the value for the askPriceSize record component
      bidPriceSize - the value for the bidPriceSize record component
  • Method Details

    • getAveragePrice

      public double getAveragePrice()
    • getTotalSize

      public long getTotalSize()
    • 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. All components in this record class are compared with '=='.
      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.
    • askSize

      public long askSize()
      Returns the value of the askSize record component.
      Returns:
      the value of the askSize record component
    • bidSize

      public long bidSize()
      Returns the value of the bidSize record component.
      Returns:
      the value of the bidSize record component
    • askPriceSize

      public long askPriceSize()
      Returns the value of the askPriceSize record component.
      Returns:
      the value of the askPriceSize record component
    • bidPriceSize

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