# Trading Configuration

# Symbols to trade
symbols:
  primary:
    - "XAUUSD"
    - "EURUSD"
    - "GBPUSD"
    - "BTCUSD"
  secondary:
    - "USDJPY"
    - "GBPJPY"
    - "AUDUSD"
    - "NZDUSD"

# Timeframes
timeframes:
  primary: 5  # 5 minutes
  aggregations:
    - 15
    - 30
    - 60
    - 240

# Features Configuration
features:
  # Minimal set (14 indicators) - optimized from analysis
  minimal:
    momentum:
      - "macd_signal"
      - "macd_histogram"
      - "rsi"
    trend:
      - "sma_10"
      - "sma_20"
      - "sar"
    volatility:
      - "atr"
    volume:
      - "obv"
      - "ad"
      - "cmf"
      - "mfi"
    patterns:
      - "fractals_high"
      - "fractals_low"
      - "volume_zscore"
      
  # Extended set for experimentation
  extended:
    momentum:
      - "stoch_k"
      - "stoch_d"
      - "cci"
    trend:
      - "ema_12"
      - "ema_26"
      - "adx"
    volatility:
      - "bollinger_upper"
      - "bollinger_lower"
      - "keltner_upper"
      - "keltner_lower"
      
  # Partial hour features (anti-repainting)
  partial_hour:
    enabled: true
    features:
      - "open_hr_partial"
      - "high_hr_partial"
      - "low_hr_partial"
      - "close_hr_partial"
      - "volume_hr_partial"
      
  # Scaling strategies
  scaling:
    strategy: "hybrid"  # Options: unscaled, scaled, ratio, hybrid
    scaler_type: "robust"  # Options: standard, robust, minmax
    winsorize:
      enabled: true
      lower: 0.01
      upper: 0.99

# Walk-Forward Validation
validation:
  strategy: "walk_forward"
  n_splits: 5
  test_size: 0.2
  gap: 0  # Gap between train and test
  
  walk_forward:
    step_pct: 0.1  # 10% step size
    min_train_size: 10000
    expanding_window: false  # If true, training set grows
    
  metrics:
    - "mse"
    - "mae"
    - "directional_accuracy"
    - "ratio_accuracy"
    - "sharpe_ratio"

# Backtesting Configuration
backtesting:
  initial_capital: 100000
  leverage: 1.0
  
  costs:
    commission_pct: 0.001  # 0.1%
    slippage_pct: 0.0005  # 0.05%
    spread_pips: 2
    
  risk_management:
    max_position_size: 0.1  # 10% of capital
    stop_loss_pct: 0.02  # 2%
    take_profit_pct: 0.04  # 4%
    trailing_stop: true
    trailing_stop_pct: 0.01
    
  position_sizing:
    method: "kelly"  # Options: fixed, kelly, risk_parity
    kelly_fraction: 0.25  # Conservative Kelly
    
# AMD Strategy Configuration
amd:
  enabled: true
  
  phases:
    accumulation:
      volume_percentile_max: 30
      price_volatility_max: 0.01
      rsi_range: [20, 40]
      obv_trend_min: 0
      
    manipulation:
      volume_zscore_min: 2.0
      price_whipsaw_range: [0.015, 0.03]
      false_breakout_threshold: 0.02
      
    distribution:
      volume_percentile_min: 70
      price_exhaustion_min: 0.02
      rsi_range: [60, 80]
      cmf_max: 0
      
  signals:
    confidence_threshold: 0.7
    confirmation_bars: 3
    
# Thresholds
thresholds:
  dynamic:
    enabled: true
    mode: "atr_std"  # Options: fixed, atr_std, percentile
    factor: 4.0
    lookback: 20
    
  fixed:
    buy: -0.02
    sell: 0.02
    
# Real-time Configuration
realtime:
  enabled: true
  update_interval: 5  # seconds
  websocket_port: 8001
  
  streaming:
    buffer_size: 1000
    max_connections: 100
    
  cache:
    predictions_ttl: 60  # seconds
    features_ttl: 300  # seconds
    
# Monitoring
monitoring:
  wandb:
    enabled: true
    project: "trading-agent"
    entity: null  # Your wandb username
    
  tensorboard:
    enabled: true
    log_dir: "logs/tensorboard"
    
  alerts:
    enabled: true
    channels:
      - "email"
      - "telegram"
    thresholds:
      drawdown_pct: 10
      loss_streak: 5
      
# Performance Optimization
optimization:
  gpu:
    memory_fraction: 0.8
    allow_growth: true
    
  data:
    num_workers: 4
    pin_memory: true
    persistent_workers: true
    prefetch_factor: 2
    
  cache:
    use_redis: true
    use_disk: true
    disk_path: "cache/"