45 lines
1.2 KiB
Python
45 lines
1.2 KiB
Python
"""
|
|
Configuration settings for Signal Generation System
|
|
Pure API mode - no Redis dependency
|
|
"""
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
"""Application settings with validation"""
|
|
|
|
model_config = SettingsConfigDict(
|
|
env_file=".env",
|
|
case_sensitive=True,
|
|
extra="ignore" # Ignore extra fields from environment
|
|
)
|
|
|
|
# Symbol Configuration
|
|
SYMBOL: str = "BTCUSDT"
|
|
|
|
# Binance API Configuration
|
|
BINANCE_API_BASE_URL: str = "https://fapi.binance.com"
|
|
|
|
# Kline intervals for multi-timeframe analysis
|
|
KLINE_INTERVALS: str = "5m,15m,1h,4h"
|
|
|
|
@property
|
|
def kline_intervals_list(self) -> list:
|
|
"""Parse kline intervals from comma-separated string"""
|
|
return [interval.strip() for interval in self.KLINE_INTERVALS.split(',')]
|
|
|
|
# Monitoring
|
|
LOG_LEVEL: str = "INFO"
|
|
|
|
# Profit filter - 不同周期的最低盈利要求
|
|
MIN_PROFIT_PCT_SHORT: float = 1.0 # 短周期 (5m/15m/1h) 最低 1%
|
|
MIN_PROFIT_PCT_MEDIUM: float = 2.0 # 中周期 (4h/1d) 最低 2%
|
|
MIN_PROFIT_PCT_LONG: float = 5.0 # 长周期 (1d/1w) 最低 5%
|
|
|
|
# 向后兼容
|
|
MIN_PROFIT_PCT: float = 1.0
|
|
PREFER_INTRADAY: bool = True
|
|
|
|
|
|
settings = Settings()
|