// 期货品种类型
export interface FuturesProduct {
  id: string;
  name: string;
  code: string;
  category: 'energy' | 'metal' | 'agriculture' | 'financial';
  price: number;
  change: number;
  changePercent: number;
  open: number;
  high: number;
  low: number;
  volume: number;
  openInterest: number;
  trendScore: number;
  successRate: number;
  cycles: {
    m5: TrendDirection;
    m15: TrendDirection;
    m30: TrendDirection;
    m60: TrendDirection;
  };
  keyLevels: {
    resistance: number[];
    support: number[];
  };
  recommendation: 'long' | 'short' | 'wait';
  recommendationReason: string;
}

// 趋势方向
export type TrendDirection = 'up' | 'down' | 'sideways';

// 热点事件
export interface HotEvent {
  id: string;
  title: string;
  time: string;
  summary: string;
  affectedProducts: string[];
  impact: 'bullish' | 'bearish' | 'neutral';
  impactLevel: 1 | 2 | 3 | 4 | 5;
  analysis: string;
  risks: string[];
}

// 市场概览数据
export interface MarketOverview {
  heatIndex: number;
  heatChange: number;
  upCount: number;
  downCount: number;
  capitalFlow: number;
  volatilityIndex: number;
  volatilityChange: number;
}

// K线数据
export interface KLineData {
  time: string;
  open: number;
  high: number;
  low: number;
  close: number;
  volume: number;
}

// MACD数据
export interface MACDData {
  time: string;
  dif: number;
  dea: number;
  macd: number;
}

// 技术指标
export interface TechnicalIndicators {
  macd: {
    signal: 'golden_cross' | 'dead_cross' | 'neutral';
    value: number;
  };
  rsi: {
    value: number;
    status: 'overbought' | 'oversold' | 'normal';
  };
  bollinger: {
    upper: number;
    middle: number;
    lower: number;
    position: 'upper' | 'middle' | 'lower';
  };
  kdj: {
    k: number;
    d: number;
    j: number;
    signal: 'golden_cross' | 'dead_cross' | 'neutral';
  };
}

// 交易建议
export interface TradingAdvice {
  action: 'long' | 'short' | 'wait';
  entryPrice: number;
  stopLoss: number;
  targetPrice: number;
  riskLevel: 'low' | 'medium' | 'high';
  position: 'light' | 'medium' | 'heavy';
  holdingTime: 'short' | 'medium' | 'long';
  reason: string;
}

// 风险提醒
export interface RiskAlert {
  id: string;
  title: string;
  affectedProducts: string[];
  riskLevel: 'high' | 'medium' | 'low';
  description: string;
  suggestion: string;
  time: string;
}

// 周期数据
export interface CycleAnalysis {
  period: 'm5' | 'm15' | 'm30' | 'm60';
  trend: TrendDirection;
  trendStrength: number;
  klineData: KLineData[];
  volumeData: { time: string; value: number }[];
  macdData: MACDData[];
  keyLevels: {
    resistance: number[];
    support: number[];
  };
}
