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 refreshescommissionBps- commission per side on traded notionalhalfSpreadBps- half the quoted spread, paid per tradeslippageBps- fixed implementation noise per tradecapital- book size in currency — impact needs real size (0 disables the impact model entirely)impactWindow- trailing bars for ADV/vol estimationperiodsPerYear- 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 Summary
ConstructorsConstructorDescriptionConfig(int startIndex, int rebalanceEveryBars, double commissionBps, double halfSpreadBps, double slippageBps, double capital, int impactWindow, int periodsPerYear) Creates an instance of aConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoublecapital()Returns the value of thecapitalrecord component.doubleReturns the value of thecommissionBpsrecord component.static AlphaBacktester.Configdefaults(int startIndex) Institutional-ish daily-bar defaults: 1bp commission, 2bp half-spread, 1bp slippage, $100m book.final booleanIndicates whether some other object is "equal to" this one.doubleReturns the value of thehalfSpreadBpsrecord component.final inthashCode()Returns a hash code value for this object.intReturns the value of theimpactWindowrecord component.intReturns the value of theperiodsPerYearrecord component.intReturns the value of therebalanceEveryBarsrecord component.doubleReturns the value of theslippageBpsrecord component.intReturns the value of thestartIndexrecord component.final StringtoString()Returns a string representation of this record class.
-
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 aConfigrecord class.- Parameters:
startIndex- the value for thestartIndexrecord componentrebalanceEveryBars- the value for therebalanceEveryBarsrecord componentcommissionBps- the value for thecommissionBpsrecord componenthalfSpreadBps- the value for thehalfSpreadBpsrecord componentslippageBps- the value for theslippageBpsrecord componentcapital- the value for thecapitalrecord componentimpactWindow- the value for theimpactWindowrecord componentperiodsPerYear- the value for theperiodsPerYearrecord component
-
-
Method Details
-
defaults
Institutional-ish daily-bar defaults: 1bp commission, 2bp half-spread, 1bp slippage, $100m book. -
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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
startIndex
public int startIndex()Returns the value of thestartIndexrecord component.- Returns:
- the value of the
startIndexrecord component
-
rebalanceEveryBars
public int rebalanceEveryBars()Returns the value of therebalanceEveryBarsrecord component.- Returns:
- the value of the
rebalanceEveryBarsrecord component
-
commissionBps
public double commissionBps()Returns the value of thecommissionBpsrecord component.- Returns:
- the value of the
commissionBpsrecord component
-
halfSpreadBps
public double halfSpreadBps()Returns the value of thehalfSpreadBpsrecord component.- Returns:
- the value of the
halfSpreadBpsrecord component
-
slippageBps
public double slippageBps()Returns the value of theslippageBpsrecord component.- Returns:
- the value of the
slippageBpsrecord component
-
capital
-
impactWindow
public int impactWindow()Returns the value of theimpactWindowrecord component.- Returns:
- the value of the
impactWindowrecord component
-
periodsPerYear
public int periodsPerYear()Returns the value of theperiodsPerYearrecord component.- Returns:
- the value of the
periodsPerYearrecord component
-