/**
 * Risk & Performance Metrics Types
 * Types for risk measurement and performance analysis
 */

/**
 * Comprehensive risk metrics
 */
export interface RiskMetrics {
  /** Value at Risk 95% */
  var95: number;
  /** Value at Risk 99% */
  var99: number;
  /** Conditional VaR 95% */
  cvar95: number;
  /** Maximum drawdown */
  maxDrawdown: number;
  /** Volatility (annualized) */
  volatility: number;
  /** Downside deviation */
  downside_deviation: number;
  /** Calmar ratio */
  calmar_ratio: number;
  /** Sortino ratio */
  sortino_ratio: number;
  /** Beta (vs benchmark) */
  beta: number;
  /** Alpha (vs benchmark) */
  alpha: number;
  /** Sharpe ratio */
  sharpeRatio: number;
  /** Treynor ratio */
  treynorRatio: number;
  /** Tracking error */
  trackingError: number;
  /** Information ratio */
  informationRatio: number;
}

/**
 * Drawdown analysis
 */
export interface DrawdownAnalysis {
  /** Maximum drawdown percentage */
  maxDrawdown: number;
  /** Maximum drawdown duration (days) */
  maxDrawdownDuration: number;
  /** Current drawdown percentage */
  currentDrawdown: number;
  /** Current drawdown duration (days) */
  currentDrawdownDuration: number;
  /** Average drawdown percentage */
  averageDrawdown: number;
  /** Average drawdown duration (days) */
  averageDrawdownDuration: number;
  /** Number of drawdown periods */
  drawdownPeriods: number;
  /** Recovery factor */
  recoveryFactor: number;
}

/**
 * Return analysis statistics
 */
export interface ReturnAnalysis {
  /** Total return */
  totalReturn: number;
  /** Annualized return */
  annualizedReturn: number;
  /** Volatility (annualized) */
  volatility: number;
  /** Skewness */
  skewness: number;
  /** Kurtosis */
  kurtosis: number;
  /** Best period return */
  bestPeriod: number;
  /** Worst period return */
  worstPeriod: number;
  /** Positive periods percentage */
  positivePeriods: number;
  /** Average positive return */
  averagePositiveReturn: number;
  /** Average negative return */
  averageNegativeReturn: number;
}
