Record Class DrawdownAnalytics.Drawdown
java.lang.Object
java.lang.Record
com.quantfinlib.backtest.DrawdownAnalytics.Drawdown
- Enclosing class:
DrawdownAnalytics
public static record DrawdownAnalytics.Drawdown(int peakIndex, int troughIndex, int recoveryIndex, double depth)
extends Record
One peak-to-recovery episode.
recoveryIndex is -1
while the drawdown is still open at series end; duration then runs
to the last bar.-
Constructor Summary
ConstructorsConstructorDescriptionDrawdown(int peakIndex, int troughIndex, int recoveryIndex, double depth) Creates an instance of aDrawdownrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubledepth()Returns the value of thedepthrecord component.intduration(int seriesLength) Periods from peak to recovery, or to series end if open.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of thepeakIndexrecord component.intReturns the value of therecoveryIndexrecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thetroughIndexrecord component.
-
Constructor Details
-
Drawdown
public Drawdown(int peakIndex, int troughIndex, int recoveryIndex, double depth) Creates an instance of aDrawdownrecord class.- Parameters:
peakIndex- the value for thepeakIndexrecord componenttroughIndex- the value for thetroughIndexrecord componentrecoveryIndex- the value for therecoveryIndexrecord componentdepth- the value for thedepthrecord component
-
-
Method Details
-
duration
public int duration(int seriesLength) Periods from peak to recovery, or to series end if open. -
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. -
peakIndex
public int peakIndex()Returns the value of thepeakIndexrecord component.- Returns:
- the value of the
peakIndexrecord component
-
troughIndex
public int troughIndex()Returns the value of thetroughIndexrecord component.- Returns:
- the value of the
troughIndexrecord component
-
recoveryIndex
public int recoveryIndex()Returns the value of therecoveryIndexrecord component.- Returns:
- the value of the
recoveryIndexrecord component
-
depth
public double depth()Returns the value of thedepthrecord component.- Returns:
- the value of the
depthrecord component
-