This commit is contained in:
aaron 2025-12-11 21:59:01 +08:00
parent e21be1b946
commit b2f994e2e9
3 changed files with 8 additions and 8 deletions

View File

@ -65,10 +65,10 @@ class VolatilityMonitor:
self, self,
symbols: List[str], symbols: List[str],
on_volatility_spike: Callable[[str, Dict], Any] = None, on_volatility_spike: Callable[[str, Dict], Any] = None,
check_interval: int = 5, # 检查间隔(秒) check_interval: int = 10, # 检查间隔(秒)- 改为10秒减少API调用
price_change_threshold: float = 0.5, # 价格变化阈值 0.5% price_change_threshold: float = 1.0, # 价格变化阈值 1% (原0.5%太敏感)
volatility_multiplier: float = 2.0, # 波动率突增倍数 volatility_multiplier: float = 2.5, # 波动率突增倍数 (原2.0)
cooldown_minutes: int = 3, # 触发后冷却时间(分钟) cooldown_minutes: int = 5, # 触发后冷却时间 5分钟 (原3分钟)
): ):
""" """
Args: Args:

View File

@ -21,8 +21,8 @@ services:
# Volatility trigger - 波动率触发 # Volatility trigger - 波动率触发
- ENABLE_VOLATILITY_TRIGGER=true - ENABLE_VOLATILITY_TRIGGER=true
- VOLATILITY_THRESHOLD=0.5 - VOLATILITY_THRESHOLD=1.0 # 1% 阈值 (原0.5%太敏感)
- VOLATILITY_COOLDOWN_MINUTES=3 - VOLATILITY_COOLDOWN_MINUTES=5 # 5分钟冷却 (原3分钟太短)
# Note: LLM API and DingTalk configs are loaded from .env file # Note: LLM API and DingTalk configs are loaded from .env file

View File

@ -333,8 +333,8 @@ async def main():
# 从环境变量获取配置 # 从环境变量获取配置
interval = int(os.getenv('SIGNAL_INTERVAL_MINUTES', '5')) interval = int(os.getenv('SIGNAL_INTERVAL_MINUTES', '5'))
enable_volatility = os.getenv('ENABLE_VOLATILITY_TRIGGER', 'true').lower() == 'true' enable_volatility = os.getenv('ENABLE_VOLATILITY_TRIGGER', 'true').lower() == 'true'
volatility_threshold = float(os.getenv('VOLATILITY_THRESHOLD', '0.5')) volatility_threshold = float(os.getenv('VOLATILITY_THRESHOLD', '1.0')) # 1% 阈值 (原0.5%太敏感)
volatility_cooldown = int(os.getenv('VOLATILITY_COOLDOWN_MINUTES', '3')) volatility_cooldown = int(os.getenv('VOLATILITY_COOLDOWN_MINUTES', '5')) # 5分钟冷却 (原3分钟)
logger.info("=" * 60) logger.info("=" * 60)
logger.info("Signal Scheduler 配置:") logger.info("Signal Scheduler 配置:")