Record Class FeeContext

java.lang.Object
java.lang.Record
com.wualabs.qtsurfer.engine.strategy.backtest.simulation.FeeContext
Record Components:
side - BUY or SELL
liquidity - whether the fill took (Liquidity.TAKER) or made (Liquidity.MAKER) liquidity
price - the (post-slippage) execution price
baseAmount - the base amount traded
instrument - the engine-canonical instrument

public record FeeContext(OrderSide side, Liquidity liquidity, BigDecimal price, BigDecimal baseAmount, Instrument instrument) extends Record
The inputs a FeeModel needs to decide a fill's fee rate.
  • Constructor Details

    • FeeContext

      public FeeContext(OrderSide side, Liquidity liquidity, BigDecimal price, BigDecimal baseAmount, Instrument instrument)
      Creates an instance of a FeeContext record class.
      Parameters:
      side - the value for the side record component
      liquidity - the value for the liquidity record component
      price - the value for the price record component
      baseAmount - the value for the baseAmount record component
      instrument - the value for the instrument record component
  • Method Details

    • 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 Objects::equals(Object,Object).
      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.
    • side

      public OrderSide side()
      Returns the value of the side record component.
      Returns:
      the value of the side record component
    • liquidity

      public Liquidity liquidity()
      Returns the value of the liquidity record component.
      Returns:
      the value of the liquidity record component
    • price

      public BigDecimal price()
      Returns the value of the price record component.
      Returns:
      the value of the price record component
    • baseAmount

      public BigDecimal baseAmount()
      Returns the value of the baseAmount record component.
      Returns:
      the value of the baseAmount record component
    • instrument

      public Instrument instrument()
      Returns the value of the instrument record component.
      Returns:
      the value of the instrument record component