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 Details

    • Config

      public Config(int lookbackBars, int skipBars, int perSide, double grossPerSide)
      Creates an instance of a Config record class.
      Parameters:
      lookbackBars - the value for the lookbackBars record component
      skipBars - the value for the skipBars record component
      perSide - the value for the perSide record component
      grossPerSide - the value for the grossPerSide record component
  • Method Details

    • twelveMinusOne

      public static CrossSectionalMomentum.Config twelveMinusOne(int perSide)
      The academic 12-1 monthly-rebalance setup on daily bars.
    • 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.
    • lookbackBars

      public int lookbackBars()
      Returns the value of the lookbackBars record component.
      Returns:
      the value of the lookbackBars record component
    • skipBars

      public int skipBars()
      Returns the value of the skipBars record component.
      Returns:
      the value of the skipBars record component
    • perSide

      public int perSide()
      Returns the value of the perSide record component.
      Returns:
      the value of the perSide record component
    • grossPerSide

      public double grossPerSide()
      Returns the value of the grossPerSide record component.
      Returns:
      the value of the grossPerSide record component