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 Summary
ConstructorsConstructorDescriptionConfig(double initialCash, double spreadBps, double commissionBps, long defaultQueueAhead, int equitySampleEvery, double tickSize, TickSizeSchedule tickSchedule) Creates an instance of aConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of thecommissionBpsrecord component.longReturns the value of thedefaultQueueAheadrecord component.static TickBacktester.Configdefaults()final booleanIndicates whether some other object is "equal to" this one.intReturns the value of theequitySampleEveryrecord component.final inthashCode()Returns a hash code value for this object.doubleReturns the value of theinitialCashrecord component.doubleReturns the value of thespreadBpsrecord component.Returns the value of thetickSchedulerecord component.doubletickSize()Returns the value of thetickSizerecord component.final StringtoString()Returns a string representation of this record class.withCommissionBps(double bps) withDefaultQueueAhead(long qty) withEquitySampleEvery(int ticks) withSpreadBps(double bps) withTickSchedule(TickSizeSchedule schedule) Price-banded ticks: the tick in force is looked up per price.withTickSize(double size)
-
Constructor Details
-
Config
public Config(double initialCash, double spreadBps, double commissionBps, long defaultQueueAhead, int equitySampleEvery, double tickSize, TickSizeSchedule tickSchedule) Creates an instance of aConfigrecord class.- Parameters:
initialCash- the value for theinitialCashrecord componentspreadBps- the value for thespreadBpsrecord componentcommissionBps- the value for thecommissionBpsrecord componentdefaultQueueAhead- the value for thedefaultQueueAheadrecord componentequitySampleEvery- the value for theequitySampleEveryrecord componenttickSize- the value for thetickSizerecord componenttickSchedule- the value for thetickSchedulerecord component
-
-
Method Details
-
defaults
-
withSpreadBps
-
withCommissionBps
-
withDefaultQueueAhead
-
withEquitySampleEvery
-
withTickSize
-
withTickSchedule
Price-banded ticks: the tick in force is looked up per price. -
toString
-
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
initialCash
public double initialCash()Returns the value of theinitialCashrecord component.- Returns:
- the value of the
initialCashrecord component
-
spreadBps
public double spreadBps()Returns the value of thespreadBpsrecord component.- Returns:
- the value of the
spreadBpsrecord component
-
commissionBps
public double commissionBps()Returns the value of thecommissionBpsrecord component.- Returns:
- the value of the
commissionBpsrecord component
-
defaultQueueAhead
public long defaultQueueAhead()Returns the value of thedefaultQueueAheadrecord component.- Returns:
- the value of the
defaultQueueAheadrecord component
-
equitySampleEvery
public int equitySampleEvery()Returns the value of theequitySampleEveryrecord component.- Returns:
- the value of the
equitySampleEveryrecord component
-
tickSize
public double tickSize()Returns the value of thetickSizerecord component.- Returns:
- the value of the
tickSizerecord component
-
tickSchedule
Returns the value of thetickSchedulerecord component.- Returns:
- the value of the
tickSchedulerecord component
-