Record Class PortfolioBacktester.Participation
java.lang.Object
java.lang.Record
com.quantfinlib.backtest.portfolio.PortfolioBacktester.Participation
- Record Components:
maxFractionOfAdv- fraction of ADV per bar (> 0)advWindow- bars in the ADV average (≥ 1)
- Enclosing class:
PortfolioBacktester
public static record PortfolioBacktester.Participation(double maxFractionOfAdv, int advWindow)
extends Record
Participation cap: each symbol trades at most
maxFractionOfAdv × ADV shares per bar, with ADV the mean
volume of the advWindow bars before the fill bar (fewer at the
start of the data; none on bar 0, so nothing trades there). A target
that the cap leaves unfinished is worked again at the next bar's fill
point, re-sized against the portfolio value then, until it is reached
or replaced by the next decision. Forced index-drop sales and
terminal events are not capped.-
Constructor Summary
ConstructorsConstructorDescriptionParticipation(double maxFractionOfAdv, int advWindow) Creates an instance of aParticipationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theadvWindowrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doubleReturns the value of themaxFractionOfAdvrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Participation
public Participation(double maxFractionOfAdv, int advWindow) Creates an instance of aParticipationrecord class.- Parameters:
maxFractionOfAdv- the value for themaxFractionOfAdvrecord componentadvWindow- the value for theadvWindowrecord component
-
-
Method Details
-
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. -
maxFractionOfAdv
public double maxFractionOfAdv()Returns the value of themaxFractionOfAdvrecord component.- Returns:
- the value of the
maxFractionOfAdvrecord component
-
advWindow
-