/**
 * Technical Analysis Types
 * Types for technical indicators and market analysis
 */

/**
 * Technical indicators collection
 */
export interface TechnicalIndicators {
  /** Simple Moving Average */
  sma: number[];
  /** Exponential Moving Average */
  ema: number[];
  /** Relative Strength Index */
  rsi: number[];
  /** MACD indicator */
  macd: {
    macd: number[];
    signal: number[];
    histogram: number[];
  };
  /** Bollinger Bands */
  bollinger: {
    upper: number[];
    middle: number[];
    lower: number[];
  };
  /** Average True Range */
  atr: number[];
  /** Stochastic Oscillator */
  stochastic: {
    k: number[];
    d: number[];
  };
  /** Williams %R */
  williams_r: number[];
  /** Commodity Channel Index */
  cci: number[];
  /** Momentum */
  momentum: number[];
  /** Rate of Change */
  roc: number[];
}

/**
 * Correlation analysis result
 */
export interface CorrelationResult {
  /** Correlation coefficient */
  correlation: number;
  /** P-value for statistical significance */
  pValue: number;
  /** Is statistically significant */
  isSignificant: boolean;
  /** Confidence interval */
  confidenceInterval: [number, number];
  /** Sample size */
  sampleSize: number;
}

/**
 * Correlation matrix
 */
export interface CorrelationMatrix {
  /** Asset symbols */
  symbols: string[];
  /** Correlation matrix values */
  matrix: number[][];
  /** Eigenvalues */
  eigenvalues: number[];
  /** Condition number */
  conditionNumber: number;
  /** Is positive definite */
  isPositiveDefinite: boolean;
}

/**
 * Volatility estimates using different models
 */
export interface VolatilityEstimates {
  /** Close-to-close volatility */
  closeToClose: number;
  /** Parkinson volatility */
  parkinson: number;
  /** Garman-Klass volatility */
  garmanKlass: number;
  /** Rogers-Satchell volatility */
  rogersSatchell: number;
  /** Yang-Zhang volatility */
  yangZhang: number;
}

/**
 * GARCH model parameters
 */
export interface GARCHParameters {
  /** Alpha parameter */
  alpha: number;
  /** Beta parameter */
  beta: number;
  /** Omega parameter */
  omega: number;
  /** Log likelihood */
  logLikelihood: number;
  /** AIC (Akaike Information Criterion) */
  aic: number;
  /** BIC (Bayesian Information Criterion) */
  bic: number;
}
