"""Application-wide constants."""

from pathlib import Path
from typing import Dict, List

# Project root directory
PROJECT_ROOT = Path(__file__).parent.parent.parent

# Supported timeframes
TIMEFRAMES: List[str] = ["1min", "5min", "15min"]

# Trading session times (EST)
SESSION_TIMES: Dict[str, str] = {
    "start": "03:00",
    "end": "04:00",
    "timezone": "America/New_York",
}

# Continuation window (3:00-3:15 EST)
CONTINUATION_WINDOW: Dict[str, str] = {
    "start": "03:00",
    "end": "03:15",
}

# Reversal window (3:30-3:50 EST)
REVERSAL_WINDOW: Dict[str, str] = {
    "start": "03:30",
    "end": "03:50",
}

# Directory paths
PATHS: Dict[str, Path] = {
    "config": PROJECT_ROOT / "config",
    "data_raw": PROJECT_ROOT / "data" / "raw",
    "data_processed": PROJECT_ROOT / "data" / "processed",
    "data_labels": PROJECT_ROOT / "data" / "labels",
    "data_screenshots": PROJECT_ROOT / "data" / "screenshots",
    "models": PROJECT_ROOT / "models",
    "logs": PROJECT_ROOT / "logs",
    "scripts": PROJECT_ROOT / "scripts",
    "tests": PROJECT_ROOT / "tests",
}

# Pattern detection thresholds
PATTERN_THRESHOLDS: Dict[str, float] = {
    "min_fvg_size_pips": 5.0,
    "min_ob_size_pips": 10.0,
    "min_liquidity_sweep_pips": 5.0,
    "atr_period": 14,
}

# Model configuration
MODEL_CONFIG: Dict[str, any] = {
    "min_labels_per_pattern": 200,
    "train_test_split": 0.8,
    "validation_split": 0.1,
    "min_accuracy_threshold": 0.75,
}

# Risk management constants
RISK_LIMITS: Dict[str, float] = {
    "max_position_size": 1,
    "max_daily_loss": 500.0,  # EUR
    "max_drawdown": 0.10,  # 10%
    "risk_per_trade": 0.02,  # 2% of account
}

# Logging constants
LOG_LEVELS: List[str] = ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"]
LOG_FORMATS: List[str] = ["json", "text"]

# Database constants
DB_CONSTANTS: Dict[str, any] = {
    "pool_size": 10,
    "max_overflow": 20,
    "pool_timeout": 30,
}

