diff --git a/notifications/telegram.py b/notifications/telegram.py index fad012f..8c8bd28 100644 --- a/notifications/telegram.py +++ b/notifications/telegram.py @@ -100,8 +100,8 @@ "strategy_name_qqq_tech_enhancement": "科技通信回调增强", "strategy_name_mega_cap_leader_rotation_top50_balanced": "Mega Cap Top50 平衡龙头轮动", "strategy_plugin_line": "🧩 插件:{plugin} | 状态:{route} | 提醒:{action}", - "strategy_plugin_alert_subject": "🚨 危机插件告警:{plugin} | {route}", - "strategy_plugin_alert_title": "🚨 【危机插件告警】", + "strategy_plugin_alert_subject": "🚨 策略插件告警:{plugin} | {route}", + "strategy_plugin_alert_title": "🚨 【策略插件告警】", "strategy_plugin_alert_context": "运行环境:{context}", "strategy_plugin_alert_strategy": "策略:{strategy}", "strategy_plugin_alert_plugin": "插件:{plugin}", @@ -109,17 +109,26 @@ "strategy_plugin_alert_action": "人工处理建议:{action}", "strategy_plugin_alert_mode": "模式:{mode}", "strategy_plugin_alert_as_of": "信号时间:{as_of}", + "strategy_plugin_alert_guidance": "处置建议:{guidance}", + "strategy_plugin_alert_scope_note": "执行范围:{scope_note}", + "strategy_plugin_alert_scope": "仅作人工复核提醒;插件不会自动下单或改仓位", "strategy_plugin_name_crisis_response_shadow": "危机观察通知", + "strategy_plugin_name_taco_rebound_shadow": "TACO 抄底观察通知", "strategy_plugin_mode_shadow": "影子观察", - "strategy_plugin_route_no_action": "未触发危机", + "strategy_plugin_route_no_action": "未触发", "strategy_plugin_route_true_crisis": "真危机", + "strategy_plugin_route_taco_rebound": "TACO 反弹确认", "strategy_plugin_route_unknown_route": "未知状态", "strategy_plugin_action_no_action": "不操作", "strategy_plugin_action_watch_only": "仅通知", + "strategy_plugin_action_notify_manual_review": "通知人工复核", "strategy_plugin_action_defend": "防守", "strategy_plugin_action_blocked": "已阻断", "strategy_plugin_action_monitor": "持续观察", "strategy_plugin_action_unknown_action": "未知提醒", + "strategy_plugin_guidance_crisis_response_shadow_true_crisis_defend": "优先考虑降低杠杆或清理杠杆仓位,暂停加仓;如需保留风险敞口,先降到可承受的小仓位。", + "strategy_plugin_guidance_crisis_response_shadow_no_action_blocked": "危机路线被风控阻断;先核对数据新鲜度和外部情境,不建议仅凭此条加仓。", + "strategy_plugin_guidance_taco_rebound_shadow_taco_rebound_notify_manual_review": "TACO 仅提示可能的反弹窗口;可考虑小仓位、分批、预设止损/失效条件的人工博弈,不建议一次性满仓。", }, "en": { "rebalance_title": "🔔 【Trade Execution Report】", @@ -206,8 +215,8 @@ "strategy_name_qqq_tech_enhancement": "Tech/Communication Pullback Enhancement", "strategy_name_mega_cap_leader_rotation_top50_balanced": "Mega Cap Leader Rotation Top50 Balanced", "strategy_plugin_line": "🧩 Plugin: {plugin} | status: {route} | notice: {action}", - "strategy_plugin_alert_subject": "🚨 Crisis plugin alert: {plugin} | {route}", - "strategy_plugin_alert_title": "🚨 【Crisis Plugin Alert】", + "strategy_plugin_alert_subject": "🚨 Strategy plugin alert: {plugin} | {route}", + "strategy_plugin_alert_title": "🚨 【Strategy Plugin Alert】", "strategy_plugin_alert_context": "Context: {context}", "strategy_plugin_alert_strategy": "Strategy: {strategy}", "strategy_plugin_alert_plugin": "Plugin: {plugin}", @@ -215,17 +224,26 @@ "strategy_plugin_alert_action": "Notice: {action}", "strategy_plugin_alert_mode": "Mode: {mode}", "strategy_plugin_alert_as_of": "Signal as-of: {as_of}", + "strategy_plugin_alert_guidance": "Manual guidance: {guidance}", + "strategy_plugin_alert_scope_note": "Execution scope: {scope_note}", + "strategy_plugin_alert_scope": "Manual review notice only; the plugin does not place orders or change allocations", "strategy_plugin_name_crisis_response_shadow": "Crisis Watch Notice", + "strategy_plugin_name_taco_rebound_shadow": "TACO Rebound Watch Notice", "strategy_plugin_mode_shadow": "shadow", - "strategy_plugin_route_no_action": "no crisis detected", + "strategy_plugin_route_no_action": "no alert", "strategy_plugin_route_true_crisis": "true crisis", + "strategy_plugin_route_taco_rebound": "TACO rebound confirmed", "strategy_plugin_route_unknown_route": "unknown status", "strategy_plugin_action_no_action": "no action", "strategy_plugin_action_watch_only": "notify only", + "strategy_plugin_action_notify_manual_review": "notify manual review", "strategy_plugin_action_defend": "defend", "strategy_plugin_action_blocked": "blocked", "strategy_plugin_action_monitor": "watch", "strategy_plugin_action_unknown_action": "unknown notice", + "strategy_plugin_guidance_crisis_response_shadow_true_crisis_defend": "Consider reducing or clearing leveraged exposure, then pause new risk additions; if keeping exposure, resize it to a small amount you can tolerate.", + "strategy_plugin_guidance_crisis_response_shadow_no_action_blocked": "A guard blocked the crisis route; verify data freshness and external context before acting on this alert.", + "strategy_plugin_guidance_taco_rebound_shadow_taco_rebound_notify_manual_review": "TACO only flags a possible rebound window; consider a small staged manual probe with a predefined invalidation level instead of full-size exposure.", }, } diff --git a/requirements.txt b/requirements.txt index 7744eda..81e193b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ flask gunicorn -quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@b520bcaa216e36b94ce60c8c6a13f982de826830 -us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@6671946c3e5525bf14c19ab03e8b059e4aa0407b +quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@f176f5d1f208724381278c253941cbc6d0a1c964 +us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@f206ae7a5f2772873c8e3907daa8d753f616348c pandas requests pytz diff --git a/tests/test_notifications.py b/tests/test_notifications.py index fc19b3f..d6e74ee 100644 --- a/tests/test_notifications.py +++ b/tests/test_notifications.py @@ -80,7 +80,7 @@ def test_build_translator_supports_chinese(self): route=translate("strategy_plugin_route_no_action"), action=translate("strategy_plugin_action_monitor"), ), - "🧩 插件:危机观察通知 | 状态:未触发危机 | 提醒:持续观察", + "🧩 插件:危机观察通知 | 状态:未触发 | 提醒:持续观察", ) self.assertEqual( translate(