/**
 * Financial Calculations Library
 *
 * This module provides a core set of financial calculations for trading and investment analysis.
 * Focuses on basic calculations and standardized type exports.
 */

// Re-export all standardized types from @stock-bot/types
export type {
  OHLCV,
  OHLCVWithMetadata,
  PortfolioPosition,
  PortfolioAnalysis,
  AssetAllocation,
  TradeExecution,
  TradePerformance,
  RiskMetrics,
  DrawdownAnalysis,
  ReturnAnalysis,
  OptionParameters,
  OptionPricing,
  GreeksCalculation,
  MarketData,
  LiquidityMetrics,
  MarketRegime,
  PositionSizeParams,
  KellyParams,
  BalanceSheet,
  IncomeStatement,
  CashFlowStatement,
  TechnicalIndicators,
  CorrelationResult,
  CorrelationMatrix,
  VolatilityEstimates,
  GARCHParameters,
  BacktestResults,
  HasClose,
  HasOHLC,
  HasVolume,
  HasTimestamp,
} from '@stock-bot/types';

// Export working calculation functions
export * from './basic-calculations';

// Export working technical indicators (building one by one)
export {
  sma,
  ema,
  rsi,
  macd,
  bollingerBands,
  atr,
  obv,
  stochastic,
  williamsR,
  cci,
  mfi,
  vwma,
  momentum,
  roc,
  accumulationDistribution,
  aroon,
  adx,
  parabolicSAR,
  chaikinMoneyFlow,
  pivotPoints,
  ichimoku,
  ultimateOscillator,
  easeOfMovement,
  tema,
  wma,
  keltnerChannels,
  donchianChannels,
  klingerVolumeOscillator,
  priceOscillator,
  chandeMomentumOscillator,
  stochasticRSI,
  vortexIndicator,
  balanceOfPower,
  trix,
  massIndex,
  coppockCurve,
} from './technical-indicators';
export * from './risk-metrics';
export * from './performance-metrics';

// Convenience function for comprehensive portfolio analysis
export function analyzePortfolio(
  _returns: number[],
  _equityCurve: Array<{ value: number; date: Date }>,
  _benchmarkReturns?: number[],
  _riskFreeRate: number = 0.02
): {
  performance: any;
  risk: any;
} {
  // Note: Implementation depends on performance-metrics and risk-metrics
  // This is a placeholder for the full implementation
  return {
    performance: {},
    risk: {},
  };
}
