Record Class CrossSectionalMomentum.Config
java.lang.Object
java.lang.Record
com.quantfinlib.backtest.portfolio.CrossSectionalMomentum.Config
- Record Components:
lookbackBars- momentum window (252 ≈ 12 months of dailies)skipBars- most-recent bars excluded (21 ≈ 1 month)perSide- names held long and short (shrinks when the member count can't fill both sides without overlap)grossPerSide- total absolute weight per side (0.5 → 1× gross, dollar-neutral)
- Enclosing class:
CrossSectionalMomentum
public static record CrossSectionalMomentum.Config(int lookbackBars, int skipBars, int perSide, double grossPerSide)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionConfig(int lookbackBars, int skipBars, int perSide, double grossPerSide) Creates an instance of aConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.doubleReturns the value of thegrossPerSiderecord component.final inthashCode()Returns a hash code value for this object.intReturns the value of thelookbackBarsrecord component.intperSide()Returns the value of theperSiderecord component.intskipBars()Returns the value of theskipBarsrecord component.final StringtoString()Returns a string representation of this record class.twelveMinusOne(int perSide) The academic 12-1 monthly-rebalance setup on daily bars.
-
Constructor Details
-
Config
public Config(int lookbackBars, int skipBars, int perSide, double grossPerSide) Creates an instance of aConfigrecord class.- Parameters:
lookbackBars- the value for thelookbackBarsrecord componentskipBars- the value for theskipBarsrecord componentperSide- the value for theperSiderecord componentgrossPerSide- the value for thegrossPerSiderecord component
-
-
Method Details
-
twelveMinusOne
The academic 12-1 monthly-rebalance setup on daily bars. -
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. -
lookbackBars
public int lookbackBars()Returns the value of thelookbackBarsrecord component.- Returns:
- the value of the
lookbackBarsrecord component
-
skipBars
-
perSide
-
grossPerSide
public double grossPerSide()Returns the value of thegrossPerSiderecord component.- Returns:
- the value of the
grossPerSiderecord component
-