import os

class Config:
    # Server settings
    PORT = int(os.getenv('TRADE_SERVER_PORT', 9527))
    HOST = os.getenv('TRADE_SERVER_HOST', '0.0.0.0')
    DEBUG = False

    # Trading hours
    MARKET_OPEN_TIME = "09:20"
    MARKET_ACTIVE_TIME = "09:15"
    MARKET_CLOSE_TIME = "15:10"

    # Logging
    LOG_DIR = "logs"
    LOG_LEVEL = "INFO"
    LOG_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
    LOG_MAX_BYTES = 10 * 1024 * 1024  # 10MB
    LOG_BACKUP_COUNT = 5

    # API Rate limiting
    RATE_LIMIT_REQUESTS = 100
    RATE_LIMIT_PERIOD = 60  # seconds

    # XtQuant 相关配置
    XT_ACCOUNT = os.getenv('XT_ACCOUNT', '80391818')
    XT_PATH = os.getenv('XT_PATH', r'C:\\江海证券QMT实盘_交易\\userdata_mini')
