Record Class HftQuoter.Config

java.lang.Object
java.lang.Record
com.quantfinlib.trading.HftQuoter.Config
Enclosing class:
HftQuoter

public static record HftQuoter.Config(long quoteSize, double halfSpread, double skewPerUnit, long minRequoteIntervalNanos, double minMove, TickSizeSchedule tickSchedule) extends Record
Quoting parameters. halfSpread/skewPerUnit/minMove are in price terms (use fx.CurrencyPair#priceFromPips to convert market conventions); tickSchedule is optional grid snapping (null = quote raw prices).
  • Constructor Summary

    Constructors
    Constructor
    Description
    Config(long quoteSize, double halfSpread, double skewPerUnit, long minRequoteIntervalNanos, double minMove, TickSizeSchedule tickSchedule)
    Creates an instance of a Config record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    double
    Returns the value of the halfSpread record component.
    final int
    Returns a hash code value for this object.
    double
    Returns the value of the minMove record component.
    long
    Returns the value of the minRequoteIntervalNanos record component.
    of(long quoteSize, double halfSpread)
    Minimal config: size and half-spread, no skew, no conflation, no grid.
    long
    Returns the value of the quoteSize record component.
    double
    Returns the value of the skewPerUnit record component.
    Returns the value of the tickSchedule record component.
    final String
    Returns a string representation of this record class.
    withConflation(long minIntervalNanos, double minMovePrice)
    Suppresses a re-quote only when the mid moved less than minMovePrice AND the last quote is younger than minIntervalNanos — BOTH gates must pass to suppress.
    withMinMove(double minMovePrice)
    Purely move-gated conflation: re-quote only when the mid has moved at least minMovePrice, regardless of age (the interval gate is set effectively infinite).
    withSkewPerUnit(double skew)
     
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Config

      public Config(long quoteSize, double halfSpread, double skewPerUnit, long minRequoteIntervalNanos, double minMove, TickSizeSchedule tickSchedule)
      Creates an instance of a Config record class.
      Parameters:
      quoteSize - the value for the quoteSize record component
      halfSpread - the value for the halfSpread record component
      skewPerUnit - the value for the skewPerUnit record component
      minRequoteIntervalNanos - the value for the minRequoteIntervalNanos record component
      minMove - the value for the minMove record component
      tickSchedule - the value for the tickSchedule record component
  • Method Details

    • of

      public static HftQuoter.Config of(long quoteSize, double halfSpread)
      Minimal config: size and half-spread, no skew, no conflation, no grid.
    • withSkewPerUnit

      public HftQuoter.Config withSkewPerUnit(double skew)
    • withConflation

      public HftQuoter.Config withConflation(long minIntervalNanos, double minMovePrice)
      Suppresses a re-quote only when the mid moved less than minMovePrice AND the last quote is younger than minIntervalNanos — BOTH gates must pass to suppress.

      Pitfall: minIntervalNanos = 0 therefore disables conflation entirely (nothing is ever "younger than 0 ns"), it does NOT mean "suppress on move alone". For purely move-gated conflation — the usual choice for derived crosses — use withMinMove(double).

    • withMinMove

      public HftQuoter.Config withMinMove(double minMovePrice)
      Purely move-gated conflation: re-quote only when the mid has moved at least minMovePrice, regardless of age (the interval gate is set effectively infinite). This is the fan-out control that makes dense synthetic-cross books scale — measured: 10,000 crosses over 200 legs run at ~8× the throughput of quote-everything with a 2-pip gate suppressing ~99% of updates.
    • withTickSchedule

      public HftQuoter.Config withTickSchedule(TickSizeSchedule schedule)
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • quoteSize

      public long quoteSize()
      Returns the value of the quoteSize record component.
      Returns:
      the value of the quoteSize record component
    • halfSpread

      public double halfSpread()
      Returns the value of the halfSpread record component.
      Returns:
      the value of the halfSpread record component
    • skewPerUnit

      public double skewPerUnit()
      Returns the value of the skewPerUnit record component.
      Returns:
      the value of the skewPerUnit record component
    • minRequoteIntervalNanos

      public long minRequoteIntervalNanos()
      Returns the value of the minRequoteIntervalNanos record component.
      Returns:
      the value of the minRequoteIntervalNanos record component
    • minMove

      public double minMove()
      Returns the value of the minMove record component.
      Returns:
      the value of the minMove record component
    • tickSchedule

      public TickSizeSchedule tickSchedule()
      Returns the value of the tickSchedule record component.
      Returns:
      the value of the tickSchedule record component