From e16a5fa687fcfddf010933a62a4fa847b2394d54 Mon Sep 17 00:00:00 2001 From: Pigbibi <20649888+Pigbibi@users.noreply.github.com> Date: Tue, 26 May 2026 14:30:21 +0800 Subject: [PATCH 1/2] Add strategy plugin alert guidance copy --- notifications/telegram.py | 12 ++++++++++++ requirements.txt | 2 +- tests/test_notifications.py | 4 ++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/notifications/telegram.py b/notifications/telegram.py index e3b5a10..83850b6 100644 --- a/notifications/telegram.py +++ b/notifications/telegram.py @@ -86,6 +86,9 @@ "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": "影子观察", @@ -100,6 +103,9 @@ "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 仅提示可能的反弹窗口;可考虑小仓位、分批、预设止损/失效条件的人工博弈,不建议一次性满仓。", "no_trades": "✅ 无需调仓", "emergency": "🛡️ 金丝雀应急: {n_bad}/4 坏, 全部转入 {safe}", "quarterly": "📊 季度调仓: 前 {n} 名轮动", @@ -213,6 +219,9 @@ "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", @@ -227,6 +236,9 @@ "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.", "no_trades": "✅ No rebalance needed", "emergency": "🛡️ Canary Emergency: {n_bad}/4 bad, rotating to {safe}", "quarterly": "📊 Quarterly Rebalance: Top {n} rotation", diff --git a/requirements.txt b/requirements.txt index 0a6e729..db76ed8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ flask gunicorn -quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@b520bcaa216e36b94ce60c8c6a13f982de826830 +quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@f176f5d1f208724381278c253941cbc6d0a1c964 us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@6671946c3e5525bf14c19ab03e8b059e4aa0407b pandas numpy diff --git a/tests/test_notifications.py b/tests/test_notifications.py index c5ca4f8..3899758 100644 --- a/tests/test_notifications.py +++ b/tests/test_notifications.py @@ -56,6 +56,10 @@ def test_build_translator_supports_chinese(): ) == "🧩 插件:TACO 抄底观察通知 | 状态:TACO 反弹确认 | 提醒:通知人工复核" ) + assert translate("strategy_plugin_alert_guidance", guidance="小仓位博弈") == "处置建议:小仓位博弈" + assert translate("strategy_plugin_alert_scope_note", scope_note="不会自动下单") == "执行范围:不会自动下单" + assert "降低杠杆" in translate("strategy_plugin_guidance_crisis_response_shadow_true_crisis_defend") + assert "小仓位" in translate("strategy_plugin_guidance_taco_rebound_shadow_taco_rebound_notify_manual_review") assert translate("account_ids_detail", account_ids="U18308207") == "🆔 账户: U18308207" assert ( translate( From fe7126468d950dccb5a40b6ea7e2c94fe440aded Mon Sep 17 00:00:00 2001 From: Pigbibi <20649888+Pigbibi@users.noreply.github.com> Date: Tue, 26 May 2026 14:35:00 +0800 Subject: [PATCH 2/2] Update UsEquityStrategies pin for alert guidance --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index db76ed8..b9ca8c6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ flask gunicorn quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@f176f5d1f208724381278c253941cbc6d0a1c964 -us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@6671946c3e5525bf14c19ab03e8b059e4aa0407b +us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@f206ae7a5f2772873c8e3907daa8d753f616348c pandas numpy requests