import { Grid, TextField, FormControl, InputLabel, Select, MenuItem, Typography, Box } from '@mui/material'
import { Info } from '@mui/icons-material'

interface StrategyParameterFormProps {
  strategyType: string
  parameters: Record<string, any>
  onChange: (parameters: Record<string, any>) => void
}

export default function StrategyParameterForm({
  strategyType,
  parameters,
  onChange,
}: StrategyParameterFormProps) {
  const updateParameter = (key: string, value: any) => {
    onChange({ ...parameters, [key]: value })
  }

  const renderRSIParameters = () => (
    <Grid container spacing={2}>
      <Grid item xs={12} md={4}>
        <TextField
          fullWidth
          label="RSI Period"
          type="number"
          value={parameters.rsi_period || 14}
          onChange={(e) => updateParameter('rsi_period', parseInt(e.target.value) || 14)}
          inputProps={{ min: 2, max: 100 }}
          helperText="Period for RSI calculation"
        />
      </Grid>
      <Grid item xs={12} md={4}>
        <TextField
          fullWidth
          label="Oversold Threshold"
          type="number"
          value={parameters.oversold || 30}
          onChange={(e) => updateParameter('oversold', parseFloat(e.target.value) || 30)}
          inputProps={{ min: 0, max: 50 }}
          helperText="RSI level considered oversold"
        />
      </Grid>
      <Grid item xs={12} md={4}>
        <TextField
          fullWidth
          label="Overbought Threshold"
          type="number"
          value={parameters.overbought || 70}
          onChange={(e) => updateParameter('overbought', parseFloat(e.target.value) || 70)}
          inputProps={{ min: 50, max: 100 }}
          helperText="RSI level considered overbought"
        />
      </Grid>
    </Grid>
  )

  const renderMACDParameters = () => (
    <Grid container spacing={2}>
      <Grid item xs={12} md={4}>
        <TextField
          fullWidth
          label="Fast Period"
          type="number"
          value={parameters.fast_period || 12}
          onChange={(e) => updateParameter('fast_period', parseInt(e.target.value) || 12)}
          inputProps={{ min: 1, max: 50 }}
        />
      </Grid>
      <Grid item xs={12} md={4}>
        <TextField
          fullWidth
          label="Slow Period"
          type="number"
          value={parameters.slow_period || 26}
          onChange={(e) => updateParameter('slow_period', parseInt(e.target.value) || 26)}
          inputProps={{ min: 1, max: 100 }}
        />
      </Grid>
      <Grid item xs={12} md={4}>
        <TextField
          fullWidth
          label="Signal Period"
          type="number"
          value={parameters.signal_period || 9}
          onChange={(e) => updateParameter('signal_period', parseInt(e.target.value) || 9)}
          inputProps={{ min: 1, max: 50 }}
        />
      </Grid>
    </Grid>
  )

  const renderMovingAverageParameters = () => (
    <Grid container spacing={2}>
      <Grid item xs={12} md={4}>
        <TextField
          fullWidth
          label="Short MA Period"
          type="number"
          value={parameters.short_period || 20}
          onChange={(e) => updateParameter('short_period', parseInt(e.target.value) || 20)}
          inputProps={{ min: 1, max: 200 }}
        />
      </Grid>
      <Grid item xs={12} md={4}>
        <TextField
          fullWidth
          label="Long MA Period"
          type="number"
          value={parameters.long_period || 50}
          onChange={(e) => updateParameter('long_period', parseInt(e.target.value) || 50)}
          inputProps={{ min: 1, max: 200 }}
        />
      </Grid>
      <Grid item xs={12} md={4}>
        <FormControl fullWidth>
          <InputLabel>MA Type</InputLabel>
          <Select
            value={parameters.ma_type || 'ema'}
            label="MA Type"
            onChange={(e) => updateParameter('ma_type', e.target.value)}
          >
            <MenuItem value="sma">SMA (Simple)</MenuItem>
            <MenuItem value="ema">EMA (Exponential)</MenuItem>
          </Select>
        </FormControl>
      </Grid>
    </Grid>
  )

  const renderDCAParameters = () => (
    <Grid container spacing={2}>
      <Grid item xs={12} md={6}>
        <TextField
          fullWidth
          label="Amount per Interval"
          type="number"
          value={parameters.amount || 10}
          onChange={(e) => updateParameter('amount', parseFloat(e.target.value) || 10)}
          inputProps={{ min: 0.01, step: 0.01 }}
          helperText="Fixed amount to invest per interval"
        />
      </Grid>
      <Grid item xs={12} md={6}>
        <FormControl fullWidth>
          <InputLabel>Interval</InputLabel>
          <Select
            value={parameters.interval || 'daily'}
            label="Interval"
            onChange={(e) => updateParameter('interval', e.target.value)}
          >
            <MenuItem value="daily">Daily</MenuItem>
            <MenuItem value="weekly">Weekly</MenuItem>
            <MenuItem value="monthly">Monthly</MenuItem>
          </Select>
        </FormControl>
      </Grid>
      <Grid item xs={12} md={6}>
        <TextField
          fullWidth
          label="Target Allocation (%)"
          type="number"
          value={parameters.target_allocation || 10}
          onChange={(e) => updateParameter('target_allocation', parseFloat(e.target.value) || 10)}
          inputProps={{ min: 0.1, max: 100, step: 0.1 }}
          helperText="Target portfolio allocation percentage"
        />
      </Grid>
    </Grid>
  )

  const renderGridParameters = () => (
    <Grid container spacing={2}>
      <Grid item xs={12} md={6}>
        <TextField
          fullWidth
          label="Grid Spacing (%)"
          type="number"
          value={parameters.grid_spacing || 1}
          onChange={(e) => updateParameter('grid_spacing', parseFloat(e.target.value) || 1)}
          inputProps={{ min: 0.1, max: 10, step: 0.1 }}
          helperText="Percentage spacing between grid levels"
        />
      </Grid>
      <Grid item xs={12} md={6}>
        <TextField
          fullWidth
          label="Number of Levels"
          type="number"
          value={parameters.num_levels || 10}
          onChange={(e) => updateParameter('num_levels', parseInt(e.target.value) || 10)}
          inputProps={{ min: 1, max: 50 }}
          helperText="Grid levels above and below center"
        />
      </Grid>
      <Grid item xs={12} md={6}>
        <TextField
          fullWidth
          label="Profit Target (%)"
          type="number"
          value={parameters.profit_target || 2}
          onChange={(e) => updateParameter('profit_target', parseFloat(e.target.value) || 2)}
          inputProps={{ min: 0.1, max: 50, step: 0.1 }}
          helperText="Profit percentage to take"
        />
      </Grid>
    </Grid>
  )

  const renderMomentumParameters = () => (
    <Grid container spacing={2}>
      <Grid item xs={12} md={6}>
        <TextField
          fullWidth
          label="Lookback Period"
          type="number"
          value={parameters.lookback_period || 20}
          onChange={(e) => updateParameter('lookback_period', parseInt(e.target.value) || 20)}
          inputProps={{ min: 1, max: 100 }}
          helperText="Period for momentum calculation"
        />
      </Grid>
      <Grid item xs={12} md={6}>
        <TextField
          fullWidth
          label="Momentum Threshold"
          type="number"
          value={parameters.momentum_threshold || 0.05}
          onChange={(e) => updateParameter('momentum_threshold', parseFloat(e.target.value) || 0.05)}
          inputProps={{ min: 0, max: 1, step: 0.01 }}
          helperText="Minimum momentum to enter (0.05 = 5%)"
        />
      </Grid>
      <Grid item xs={12} md={6}>
        <TextField
          fullWidth
          label="Volume Threshold"
          type="number"
          value={parameters.volume_threshold || 1.5}
          onChange={(e) => updateParameter('volume_threshold', parseFloat(e.target.value) || 1.5)}
          inputProps={{ min: 1, max: 10, step: 0.1 }}
          helperText="Volume increase multiplier for confirmation"
        />
      </Grid>
      <Grid item xs={12} md={6}>
        <TextField
          fullWidth
          label="Exit Threshold"
          type="number"
          value={parameters.exit_threshold || -0.02}
          onChange={(e) => updateParameter('exit_threshold', parseFloat(e.target.value) || -0.02)}
          inputProps={{ min: -1, max: 0, step: 0.01 }}
          helperText="Momentum reversal threshold for exit"
        />
      </Grid>
    </Grid>
  )

  const renderConfirmedParameters = () => (
    <Grid container spacing={2}>
      <Grid item xs={12}>
        <Typography variant="subtitle2" gutterBottom>
          RSI Parameters
        </Typography>
      </Grid>
      <Grid item xs={12} md={4}>
        <TextField
          fullWidth
          label="RSI Period"
          type="number"
          value={parameters.rsi_period || 14}
          onChange={(e) => updateParameter('rsi_period', parseInt(e.target.value) || 14)}
        />
      </Grid>
      <Grid item xs={12} md={4}>
        <TextField
          fullWidth
          label="RSI Oversold"
          type="number"
          value={parameters.rsi_oversold || 30}
          onChange={(e) => updateParameter('rsi_oversold', parseFloat(e.target.value) || 30)}
        />
      </Grid>
      <Grid item xs={12} md={4}>
        <TextField
          fullWidth
          label="RSI Overbought"
          type="number"
          value={parameters.rsi_overbought || 70}
          onChange={(e) => updateParameter('rsi_overbought', parseFloat(e.target.value) || 70)}
        />
      </Grid>
      <Grid item xs={12}>
        <Typography variant="subtitle2" gutterBottom sx={{ mt: 2 }}>
          MACD Parameters
        </Typography>
      </Grid>
      <Grid item xs={12} md={4}>
        <TextField
          fullWidth
          label="MACD Fast"
          type="number"
          value={parameters.macd_fast || 12}
          onChange={(e) => updateParameter('macd_fast', parseInt(e.target.value) || 12)}
        />
      </Grid>
      <Grid item xs={12} md={4}>
        <TextField
          fullWidth
          label="MACD Slow"
          type="number"
          value={parameters.macd_slow || 26}
          onChange={(e) => updateParameter('macd_slow', parseInt(e.target.value) || 26)}
        />
      </Grid>
      <Grid item xs={12} md={4}>
        <TextField
          fullWidth
          label="MACD Signal"
          type="number"
          value={parameters.macd_signal || 9}
          onChange={(e) => updateParameter('macd_signal', parseInt(e.target.value) || 9)}
        />
      </Grid>
      <Grid item xs={12}>
        <Typography variant="subtitle2" gutterBottom sx={{ mt: 2 }}>
          Moving Average Parameters
        </Typography>
      </Grid>
      <Grid item xs={12} md={4}>
        <TextField
          fullWidth
          label="MA Fast Period"
          type="number"
          value={parameters.ma_fast || 10}
          onChange={(e) => updateParameter('ma_fast', parseInt(e.target.value) || 10)}
        />
      </Grid>
      <Grid item xs={12} md={4}>
        <TextField
          fullWidth
          label="MA Slow Period"
          type="number"
          value={parameters.ma_slow || 30}
          onChange={(e) => updateParameter('ma_slow', parseInt(e.target.value) || 30)}
        />
      </Grid>
      <Grid item xs={12} md={4}>
        <FormControl fullWidth>
          <InputLabel>MA Type</InputLabel>
          <Select
            value={parameters.ma_type || 'ema'}
            label="MA Type"
            onChange={(e) => updateParameter('ma_type', e.target.value)}
          >
            <MenuItem value="sma">SMA</MenuItem>
            <MenuItem value="ema">EMA</MenuItem>
          </Select>
        </FormControl>
      </Grid>
      <Grid item xs={12}>
        <Typography variant="subtitle2" gutterBottom sx={{ mt: 2 }}>
          Confirmation Settings
        </Typography>
      </Grid>
      <Grid item xs={12} md={6}>
        <TextField
          fullWidth
          label="Min Confirmations"
          type="number"
          value={parameters.min_confirmations || 2}
          onChange={(e) => updateParameter('min_confirmations', parseInt(e.target.value) || 2)}
          inputProps={{ min: 1, max: 3 }}
          helperText="Minimum indicators that must agree"
        />
      </Grid>
    </Grid>
  )

  const renderDivergenceParameters = () => (
    <Grid container spacing={2}>
      <Grid item xs={12} md={6}>
        <FormControl fullWidth>
          <InputLabel>Indicator Type</InputLabel>
          <Select
            value={parameters.indicator_type || 'rsi'}
            label="Indicator Type"
            onChange={(e) => updateParameter('indicator_type', e.target.value)}
          >
            <MenuItem value="rsi">RSI</MenuItem>
            <MenuItem value="macd">MACD</MenuItem>
          </Select>
        </FormControl>
      </Grid>
      <Grid item xs={12} md={6}>
        <TextField
          fullWidth
          label="Lookback Period"
          type="number"
          value={parameters.lookback_period || 20}
          onChange={(e) => updateParameter('lookback_period', parseInt(e.target.value) || 20)}
          inputProps={{ min: 5, max: 100 }}
          helperText="Period for swing detection"
        />
      </Grid>
      <Grid item xs={12} md={6}>
        <TextField
          fullWidth
          label="Min Swings Required"
          type="number"
          value={parameters.min_swings || 2}
          onChange={(e) => updateParameter('min_swings', parseInt(e.target.value) || 2)}
          inputProps={{ min: 1, max: 10 }}
        />
      </Grid>
      <Grid item xs={12} md={6}>
        <TextField
          fullWidth
          label="Confidence Threshold"
          type="number"
          value={parameters.confidence_threshold || 0.5}
          onChange={(e) => updateParameter('confidence_threshold', parseFloat(e.target.value) || 0.5)}
          inputProps={{ min: 0, max: 1, step: 0.1 }}
        />
      </Grid>
    </Grid>
  )

  const renderBollingerParameters = () => (
    <Grid container spacing={2}>
      <Grid item xs={12} md={6}>
        <TextField
          fullWidth
          label="Period"
          type="number"
          value={parameters.period || 20}
          onChange={(e) => updateParameter('period', parseInt(e.target.value) || 20)}
          inputProps={{ min: 5, max: 100 }}
        />
      </Grid>
      <Grid item xs={12} md={6}>
        <TextField
          fullWidth
          label="Std Dev Multiplier"
          type="number"
          value={parameters.std_dev_multiplier || 2.0}
          onChange={(e) => updateParameter('std_dev_multiplier', parseFloat(e.target.value) || 2.0)}
          inputProps={{ min: 1, max: 5, step: 0.1 }}
        />
      </Grid>
      <Grid item xs={12} md={6}>
        <TextField
          fullWidth
          label="Trend MA Period"
          type="number"
          value={parameters.trend_ma_period || 50}
          onChange={(e) => updateParameter('trend_ma_period', parseInt(e.target.value) || 50)}
          inputProps={{ min: 10, max: 200 }}
        />
      </Grid>
      <Grid item xs={12} md={6}>
        <TextField
          fullWidth
          label="Entry Threshold"
          type="number"
          value={parameters.entry_threshold || 0.95}
          onChange={(e) => updateParameter('entry_threshold', parseFloat(e.target.value) || 0.95)}
          inputProps={{ min: 0, max: 1, step: 0.01 }}
          helperText="How close to band (0.95 = 95%)"
        />
      </Grid>
    </Grid>
  )

  const renderConsensusParameters = () => (
    <Grid container spacing={2}>
      <Grid item xs={12} md={6}>
        <TextField
          fullWidth
          label="Min Consensus Count"
          type="number"
          value={parameters.min_consensus_count || 2}
          onChange={(e) => updateParameter('min_consensus_count', parseInt(e.target.value) || 2)}
          inputProps={{ min: 1, max: 10 }}
          helperText="Minimum strategies that must agree"
        />
      </Grid>
      <Grid item xs={12} md={6}>
        <TextField
          fullWidth
          label="Min Weight Threshold"
          type="number"
          value={parameters.min_weight_threshold || 0.3}
          onChange={(e) => updateParameter('min_weight_threshold', parseFloat(e.target.value) || 0.3)}
          inputProps={{ min: 0, max: 1, step: 0.1 }}
        />
      </Grid>
    </Grid>
  )

  const renderPairsTradingParameters = () => (
    <Grid container spacing={2}>
      <Grid item xs={12} md={12}>
        <Typography variant="body2" color="text.secondary" sx={{ mb: 2 }}>
          Statistical Arbitrage trades the spread between the main symbol and a second symbol.
        </Typography>
      </Grid>
      <Grid item xs={12} md={6}>
        <TextField
          fullWidth
          label="Second Symbol"
          value={parameters.second_symbol || 'ETH/USD'}
          onChange={(e) => updateParameter('second_symbol', e.target.value)}
          helperText="The correlated asset to pair with"
        />
      </Grid>
      <Grid item xs={12} md={6}>
        <TextField
          fullWidth
          label="Lookback Period"
          type="number"
          value={parameters.lookback_period || 20}
          onChange={(e) => updateParameter('lookback_period', parseInt(e.target.value) || 20)}
          inputProps={{ min: 5, max: 100 }}
          helperText="Rolling window for Z-Score calc"
        />
      </Grid>
      <Grid item xs={12} md={6}>
        <TextField
          fullWidth
          label="Z-Score Threshold"
          type="number"
          value={parameters.z_score_threshold || 2.0}
          onChange={(e) => updateParameter('z_score_threshold', parseFloat(e.target.value) || 2.0)}
          inputProps={{ min: 1.0, max: 5.0, step: 0.1 }}
          helperText="Entry trigger (Standard Deviations)"
        />
      </Grid>
    </Grid>
  )

  const renderVolatilityBreakoutParameters = () => (
    <Grid container spacing={2}>
      <Grid item xs={12} md={12}>
        <Typography variant="body2" color="text.secondary" sx={{ mb: 2 }}>
          Captures explosive moves after periods of low volatility (squeeze).
        </Typography>
      </Grid>
      <Grid item xs={12} md={4}>
        <TextField
          fullWidth
          label="BB Period"
          type="number"
          value={parameters.bb_period || 20}
          onChange={(e) => updateParameter('bb_period', parseInt(e.target.value) || 20)}
          inputProps={{ min: 5, max: 50 }}
          helperText="Bollinger Bands period"
        />
      </Grid>
      <Grid item xs={12} md={4}>
        <TextField
          fullWidth
          label="BB Std Dev"
          type="number"
          value={parameters.bb_std_dev || 2.0}
          onChange={(e) => updateParameter('bb_std_dev', parseFloat(e.target.value) || 2.0)}
          inputProps={{ min: 1.0, max: 4.0, step: 0.1 }}
          helperText="Standard deviation multiplier"
        />
      </Grid>
      <Grid item xs={12} md={4}>
        <TextField
          fullWidth
          label="Squeeze Threshold"
          type="number"
          value={parameters.squeeze_threshold || 0.1}
          onChange={(e) => updateParameter('squeeze_threshold', parseFloat(e.target.value) || 0.1)}
          inputProps={{ min: 0.01, max: 0.5, step: 0.01 }}
          helperText="BB Width for squeeze detection"
        />
      </Grid>
      <Grid item xs={12} md={4}>
        <TextField
          fullWidth
          label="Volume Multiplier"
          type="number"
          value={parameters.volume_multiplier || 1.5}
          onChange={(e) => updateParameter('volume_multiplier', parseFloat(e.target.value) || 1.5)}
          inputProps={{ min: 1.0, max: 5.0, step: 0.1 }}
          helperText="Min volume vs 20-day avg"
        />
      </Grid>
      <Grid item xs={12} md={4}>
        <TextField
          fullWidth
          label="Min ADX"
          type="number"
          value={parameters.min_adx || 25}
          onChange={(e) => updateParameter('min_adx', parseFloat(e.target.value) || 25)}
          inputProps={{ min: 10, max: 50 }}
          helperText="Trend strength filter"
        />
      </Grid>
    </Grid>
  )

  const renderSentimentParameters = () => (
    <Grid container spacing={2}>
      <Grid item xs={12} md={12}>
        <Typography variant="body2" color="text.secondary" sx={{ mb: 2 }}>
          Trades based on news sentiment and Fear & Greed Index.
        </Typography>
      </Grid>
      <Grid item xs={12} md={4}>
        <FormControl fullWidth>
          <InputLabel>Mode</InputLabel>
          <Select
            value={parameters.mode || 'contrarian'}
            label="Mode"
            onChange={(e) => updateParameter('mode', e.target.value)}
          >
            <MenuItem value="contrarian">Contrarian (Buy Fear, Sell Greed)</MenuItem>
            <MenuItem value="momentum">Momentum (Follow Sentiment)</MenuItem>
            <MenuItem value="combo">Combo (News + Fear = Buy)</MenuItem>
          </Select>
        </FormControl>
      </Grid>
      <Grid item xs={12} md={4}>
        <TextField
          fullWidth
          label="Min Sentiment Score"
          type="number"
          value={parameters.min_sentiment_score || 0.5}
          onChange={(e) => updateParameter('min_sentiment_score', parseFloat(e.target.value) || 0.5)}
          inputProps={{ min: 0.1, max: 1.0, step: 0.1 }}
          helperText="Threshold for momentum signals"
        />
      </Grid>
      <Grid item xs={12} md={4}>
        <TextField
          fullWidth
          label="Fear Threshold"
          type="number"
          value={parameters.fear_threshold || 25}
          onChange={(e) => updateParameter('fear_threshold', parseInt(e.target.value) || 25)}
          inputProps={{ min: 0, max: 50 }}
          helperText="F&G value for 'extreme fear'"
        />
      </Grid>
      <Grid item xs={12} md={4}>
        <TextField
          fullWidth
          label="Greed Threshold"
          type="number"
          value={parameters.greed_threshold || 75}
          onChange={(e) => updateParameter('greed_threshold', parseInt(e.target.value) || 75)}
          inputProps={{ min: 50, max: 100 }}
          helperText="F&G value for 'extreme greed'"
        />
      </Grid>
      <Grid item xs={12} md={4}>
        <TextField
          fullWidth
          label="News Lookback (hours)"
          type="number"
          value={parameters.news_lookback_hours || 24}
          onChange={(e) => updateParameter('news_lookback_hours', parseInt(e.target.value) || 24)}
          inputProps={{ min: 1, max: 72 }}
          helperText="How far back to analyze news"
        />
      </Grid>
    </Grid>
  )

  const renderMarketMakingParameters = () => (
    <Grid container spacing={2}>
      <Grid item xs={12} md={12}>
        <Typography variant="body2" color="text.secondary" sx={{ mb: 2 }}>
          Places limit orders on both sides of the spread. Best for ranging markets.
        </Typography>
      </Grid>
      <Grid item xs={12} md={4}>
        <TextField
          fullWidth
          label="Spread %"
          type="number"
          value={parameters.spread_percent || 0.2}
          onChange={(e) => updateParameter('spread_percent', parseFloat(e.target.value) || 0.2)}
          inputProps={{ min: 0.05, max: 2.0, step: 0.05 }}
          helperText="Distance from mid price"
        />
      </Grid>
      <Grid item xs={12} md={4}>
        <TextField
          fullWidth
          label="Requote Threshold %"
          type="number"
          value={parameters.requote_threshold || 0.5}
          onChange={(e) => updateParameter('requote_threshold', parseFloat(e.target.value) || 0.5)}
          inputProps={{ min: 0.1, max: 2.0, step: 0.1 }}
          helperText="Price move to trigger requote"
        />
      </Grid>
      <Grid item xs={12} md={4}>
        <TextField
          fullWidth
          label="Max Inventory"
          type="number"
          value={parameters.max_inventory || 1.0}
          onChange={(e) => updateParameter('max_inventory', parseFloat(e.target.value) || 1.0)}
          inputProps={{ min: 0.1, max: 10, step: 0.1 }}
          helperText="Max position before skewing"
        />
      </Grid>
      <Grid item xs={12} md={4}>
        <TextField
          fullWidth
          label="Inventory Skew Factor"
          type="number"
          value={parameters.inventory_skew_factor || 0.5}
          onChange={(e) => updateParameter('inventory_skew_factor', parseFloat(e.target.value) || 0.5)}
          inputProps={{ min: 0, max: 1, step: 0.1 }}
          helperText="How much to skew quotes"
        />
      </Grid>
      <Grid item xs={12} md={4}>
        <TextField
          fullWidth
          label="Max ADX (Trend Filter)"
          type="number"
          value={parameters.min_adx || 20}
          onChange={(e) => updateParameter('min_adx', parseInt(e.target.value) || 20)}
          inputProps={{ min: 10, max: 40 }}
          helperText="Skip if ADX above this"
        />
      </Grid>
    </Grid>
  )

  const renderParameters = () => {
    switch (strategyType) {
      case 'rsi':
        return renderRSIParameters()
      case 'macd':
        return renderMACDParameters()
      case 'moving_average':
        return renderMovingAverageParameters()
      case 'confirmed':
        return renderConfirmedParameters()
      case 'divergence':
        return renderDivergenceParameters()
      case 'bollinger_mean_reversion':
        return renderBollingerParameters()
      case 'consensus':
        return renderConsensusParameters()
      case 'dca':
        return renderDCAParameters()
      case 'grid':
        return renderGridParameters()
      case 'momentum':
        return renderMomentumParameters()
      case 'pairs_trading':
        return renderPairsTradingParameters()
      case 'volatility_breakout':
        return renderVolatilityBreakoutParameters()
      case 'sentiment':
        return renderSentimentParameters()
      case 'market_making':
        return renderMarketMakingParameters()
      default:
        return (
          <Box sx={{ p: 2 }}>
            <Typography color="text.secondary">
              No specific parameters for this strategy type.
            </Typography>
          </Box>
        )
    }
  }

  return (
    <Box>
      <Box sx={{ mb: 2, display: 'flex', alignItems: 'center', gap: 1 }}>
        <Info color="action" fontSize="small" />
        <Typography variant="body2" color="text.secondary">
          Configure strategy-specific parameters. Default values are provided.
        </Typography>
      </Box>
      {renderParameters()}
    </Box>
  )
}

