from __future__ import annotations

from pydantic_settings import BaseSettings, SettingsConfigDict


class Settings(BaseSettings):
    # اتصال Brain Bot
    BRAIN_BOT_URL: str = "http://localhost:9001"

    # Binance
    BINANCE_BASE_URL: str = "https://api.binance.com"
    KLINES_LIMIT: int = 100

    # إعدادات RSI
    RSI_PERIOD: int = 14

    # حدود الإشارة
    RSI_OVERSOLD: float = 30.0    # < 30 → BUY
    RSI_OVERBOUGHT: float = 70.0  # > 70 → SELL
    RSI_EXTREME_LOW: float = 20.0
    RSI_EXTREME_HIGH: float = 80.0

    # درجات الثقة
    CONFIDENCE_EXTREME_MIN: float = 0.85
    CONFIDENCE_EXTREME_MAX: float = 0.95
    CONFIDENCE_NORMAL_MIN: float = 0.50
    CONFIDENCE_NORMAL_MAX: float = 0.70

    # الإطار الزمني الافتراضي
    DEFAULT_TIMEFRAME: str = "5m"

    # الخادم
    HOST: str = "0.0.0.0"
    PORT: int = 9003
    LOG_LEVEL: str = "INFO"

    model_config = SettingsConfigDict(env_file=".env", extra="ignore")


settings = Settings()
