Record Class AlphaBacktester.Config

java.lang.Object
java.lang.Record
com.quantfinlib.alpha.AlphaBacktester.Config
Record Components:
startIndex - first tradeable bar (must cover factor warm-up and the impact estimation window)
rebalanceEveryBars - holding period between weight refreshes
commissionBps - commission per side on traded notional
halfSpreadBps - half the quoted spread, paid per trade
slippageBps - fixed implementation noise per trade
capital - book size in currency — impact needs real size (0 disables the impact model entirely)
impactWindow - trailing bars for ADV/vol estimation
periodsPerYear - bar frequency for annualized metrics
Enclosing class:
AlphaBacktester

public static record AlphaBacktester.Config(int startIndex, int rebalanceEveryBars, double commissionBps, double halfSpreadBps, double slippageBps, double capital, int impactWindow, int periodsPerYear) extends Record
  • Constructor Details

    • Config

      public Config(int startIndex, int rebalanceEveryBars, double commissionBps, double halfSpreadBps, double slippageBps, double capital, int impactWindow, int periodsPerYear)
      Creates an instance of a Config record class.
      Parameters:
      startIndex - the value for the startIndex record component
      rebalanceEveryBars - the value for the rebalanceEveryBars record component
      commissionBps - the value for the commissionBps record component
      halfSpreadBps - the value for the halfSpreadBps record component
      slippageBps - the value for the slippageBps record component
      capital - the value for the capital record component
      impactWindow - the value for the impactWindow record component
      periodsPerYear - the value for the periodsPerYear record component
  • Method Details

    • defaults

      public static AlphaBacktester.Config defaults(int startIndex)
      Institutional-ish daily-bar defaults: 1bp commission, 2bp half-spread, 1bp slippage, $100m book.
    • 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 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.
    • startIndex

      public int startIndex()
      Returns the value of the startIndex record component.
      Returns:
      the value of the startIndex record component
    • rebalanceEveryBars

      public int rebalanceEveryBars()
      Returns the value of the rebalanceEveryBars record component.
      Returns:
      the value of the rebalanceEveryBars record component
    • commissionBps

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

      public double halfSpreadBps()
      Returns the value of the halfSpreadBps record component.
      Returns:
      the value of the halfSpreadBps record component
    • slippageBps

      public double slippageBps()
      Returns the value of the slippageBps record component.
      Returns:
      the value of the slippageBps record component
    • capital

      public double capital()
      Returns the value of the capital record component.
      Returns:
      the value of the capital record component
    • impactWindow

      public int impactWindow()
      Returns the value of the impactWindow record component.
      Returns:
      the value of the impactWindow record component
    • periodsPerYear

      public int periodsPerYear()
      Returns the value of the periodsPerYear record component.
      Returns:
      the value of the periodsPerYear record component