/**
 * Trading & Execution Types
 * Types for trade execution and performance analysis
 */

/**
 * Trade execution record
 */
export interface TradeExecution {
  /** Trade ID */
  id?: string;
  /** Security symbol */
  symbol: string;
  /** Trade type */
  type: 'buy' | 'sell' | 'short' | 'cover';
  /** Number of shares/units */
  quantity: number;
  /** Execution price */
  price: number;
  /** Total trade value */
  value: number;
  /** Commission/fees */
  commission?: number;
  /** Execution timestamp */
  timestamp: number;
  /** Order ID reference */
  orderId?: string;
  /** Execution venue */
  venue?: string;
}

/**
 * Trade performance analysis
 */
export interface TradePerformance {
  /** Total number of trades */
  totalTrades: number;
  /** Number of winning trades */
  winningTrades: number;
  /** Number of losing trades */
  losingTrades: number;
  /** Win rate percentage */
  winRate: number;
  /** Average winning trade */
  averageWin: number;
  /** Average losing trade */
  averageLoss: number;
  /** Largest winning trade */
  largestWin: number;
  /** Largest losing trade */
  largestLoss: number;
  /** Profit factor (gross profit / gross loss) */
  profitFactor: number;
  /** Mathematical expectancy */
  expectancy: number;
  /** Total gross profit */
  grossProfit: number;
  /** Total gross loss */
  grossLoss: number;
  /** Net profit */
  netProfit: number;
}
