Record Class TickBacktester.Config

java.lang.Object
java.lang.Record
com.quantfinlib.backtest.tick.TickBacktester.Config
Enclosing class:
TickBacktester

public static record TickBacktester.Config(double initialCash, double spreadBps, double commissionBps, long defaultQueueAhead, int equitySampleEvery, double tickSize, TickSizeSchedule tickSchedule) extends Record
tickSize > 0 snaps limit-order matching to the exchange price grid (prices within the same tick are one level); 0 falls back to epsilon equality — use a real tick size with real market data. A tickSchedule (MiFID II-style price-banded ticks) takes precedence over the flat tickSize when present.
  • Constructor Details

    • Config

      public Config(double initialCash, double spreadBps, double commissionBps, long defaultQueueAhead, int equitySampleEvery, double tickSize, TickSizeSchedule tickSchedule)
      Creates an instance of a Config record class.
      Parameters:
      initialCash - the value for the initialCash record component
      spreadBps - the value for the spreadBps record component
      commissionBps - the value for the commissionBps record component
      defaultQueueAhead - the value for the defaultQueueAhead record component
      equitySampleEvery - the value for the equitySampleEvery record component
      tickSize - the value for the tickSize record component
      tickSchedule - the value for the tickSchedule record component
  • Method Details

    • defaults

      public static TickBacktester.Config defaults()
    • withSpreadBps

      public TickBacktester.Config withSpreadBps(double bps)
    • withCommissionBps

      public TickBacktester.Config withCommissionBps(double bps)
    • withDefaultQueueAhead

      public TickBacktester.Config withDefaultQueueAhead(long qty)
    • withEquitySampleEvery

      public TickBacktester.Config withEquitySampleEvery(int ticks)
    • withTickSize

      public TickBacktester.Config withTickSize(double size)
    • withTickSchedule

      public TickBacktester.Config withTickSchedule(TickSizeSchedule schedule)
      Price-banded ticks: the tick in force is looked up per price.
    • 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.
    • initialCash

      public double initialCash()
      Returns the value of the initialCash record component.
      Returns:
      the value of the initialCash record component
    • spreadBps

      public double spreadBps()
      Returns the value of the spreadBps record component.
      Returns:
      the value of the spreadBps record component
    • commissionBps

      public double commissionBps()
      Returns the value of the commissionBps record component.
      Returns:
      the value of the commissionBps record component
    • defaultQueueAhead

      public long defaultQueueAhead()
      Returns the value of the defaultQueueAhead record component.
      Returns:
      the value of the defaultQueueAhead record component
    • equitySampleEvery

      public int equitySampleEvery()
      Returns the value of the equitySampleEvery record component.
      Returns:
      the value of the equitySampleEvery record component
    • tickSize

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

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