Record Class PerformanceMetrics
java.lang.Object
java.lang.Record
com.quantfinlib.backtest.PerformanceMetrics
public record PerformanceMetrics(double totalReturn, double cagr, double annualizedReturn, double annualizedVolatility, double sharpeRatio, double sortinoRatio, double calmarRatio, double maxDrawdown, double profitFactor, double winRate, int tradeCount, double finalEquity)
extends Record
Strategy performance analytics. Returns/drawdown are fractions; ratios are
annualized.
-
Constructor Summary
ConstructorsConstructorDescriptionPerformanceMetrics(double totalReturn, double cagr, double annualizedReturn, double annualizedVolatility, double sharpeRatio, double sortinoRatio, double calmarRatio, double maxDrawdown, double profitFactor, double winRate, int tradeCount, double finalEquity) Creates an instance of aPerformanceMetricsrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of theannualizedReturnrecord component.doubleReturns the value of theannualizedVolatilityrecord component.doublecagr()Returns the value of thecagrrecord component.doubleReturns the value of thecalmarRatiorecord component.final booleanIndicates whether some other object is "equal to" this one.doubleReturns the value of thefinalEquityrecord component.final inthashCode()Returns a hash code value for this object.doubleReturns the value of themaxDrawdownrecord component.doubleReturns the value of theprofitFactorrecord component.doubleReturns the value of thesharpeRatiorecord component.doubleReturns the value of thesortinoRatiorecord component.final StringtoString()Returns a string representation of this record class.doubleReturns the value of thetotalReturnrecord component.intReturns the value of thetradeCountrecord component.doublewinRate()Returns the value of thewinRaterecord component.
-
Constructor Details
-
PerformanceMetrics
public PerformanceMetrics(double totalReturn, double cagr, double annualizedReturn, double annualizedVolatility, double sharpeRatio, double sortinoRatio, double calmarRatio, double maxDrawdown, double profitFactor, double winRate, int tradeCount, double finalEquity) Creates an instance of aPerformanceMetricsrecord class.- Parameters:
totalReturn- the value for thetotalReturnrecord componentcagr- the value for thecagrrecord componentannualizedReturn- the value for theannualizedReturnrecord componentannualizedVolatility- the value for theannualizedVolatilityrecord componentsharpeRatio- the value for thesharpeRatiorecord componentsortinoRatio- the value for thesortinoRatiorecord componentcalmarRatio- the value for thecalmarRatiorecord componentmaxDrawdown- the value for themaxDrawdownrecord componentprofitFactor- the value for theprofitFactorrecord componentwinRate- the value for thewinRaterecord componenttradeCount- the value for thetradeCountrecord componentfinalEquity- the value for thefinalEquityrecord 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. -
totalReturn
public double totalReturn()Returns the value of thetotalReturnrecord component.- Returns:
- the value of the
totalReturnrecord component
-
cagr
public double cagr()Returns the value of thecagrrecord component.- Returns:
- the value of the
cagrrecord component
-
annualizedReturn
public double annualizedReturn()Returns the value of theannualizedReturnrecord component.- Returns:
- the value of the
annualizedReturnrecord component
-
annualizedVolatility
public double annualizedVolatility()Returns the value of theannualizedVolatilityrecord component.- Returns:
- the value of the
annualizedVolatilityrecord component
-
sharpeRatio
public double sharpeRatio()Returns the value of thesharpeRatiorecord component.- Returns:
- the value of the
sharpeRatiorecord component
-
sortinoRatio
public double sortinoRatio()Returns the value of thesortinoRatiorecord component.- Returns:
- the value of the
sortinoRatiorecord component
-
calmarRatio
public double calmarRatio()Returns the value of thecalmarRatiorecord component.- Returns:
- the value of the
calmarRatiorecord component
-
maxDrawdown
public double maxDrawdown()Returns the value of themaxDrawdownrecord component.- Returns:
- the value of the
maxDrawdownrecord component
-
profitFactor
public double profitFactor()Returns the value of theprofitFactorrecord component.- Returns:
- the value of the
profitFactorrecord component
-
winRate
public double winRate()Returns the value of thewinRaterecord component.- Returns:
- the value of the
winRaterecord component
-
tradeCount
public int tradeCount()Returns the value of thetradeCountrecord component.- Returns:
- the value of the
tradeCountrecord component
-
finalEquity
public double finalEquity()Returns the value of thefinalEquityrecord component.- Returns:
- the value of the
finalEquityrecord component
-