Spaces:
Sleeping
Sleeping
File size: 1,239 Bytes
f5cd2d3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | package com.rods.backtestingstrategies.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* Advanced performance metrics for a backtest result.
* Calculated from equity curve and transaction history.
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class PerformanceMetrics {
// Risk-adjusted return (annualized)
private double sharpeRatio;
// Worst peak-to-trough decline (as negative %)
private double maxDrawdown;
// Percentage of profitable trades
private double winRate;
// Average profit on winning trades
private double avgWin;
// Average loss on losing trades
private double avgLoss;
// Ratio of average win to average loss
private double winLossRatio;
// Total number of trades executed
private int totalTrades;
// Number of winning trades
private int winningTrades;
// Number of losing trades
private int losingTrades;
// Annualized return percentage
private double annualizedReturn;
// Profit factor: gross profit / gross loss
private double profitFactor;
// Average holding period in days
private double avgHoldingPeriodDays;
}
|