Skip to content

Commit e16a5fa

Browse files
committed
Add strategy plugin alert guidance copy
1 parent 78af69a commit e16a5fa

3 files changed

Lines changed: 17 additions & 1 deletion

File tree

notifications/telegram.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@
8686
"strategy_plugin_alert_action": "人工处理建议:{action}",
8787
"strategy_plugin_alert_mode": "模式:{mode}",
8888
"strategy_plugin_alert_as_of": "信号时间:{as_of}",
89+
"strategy_plugin_alert_guidance": "处置建议:{guidance}",
90+
"strategy_plugin_alert_scope_note": "执行范围:{scope_note}",
91+
"strategy_plugin_alert_scope": "仅作人工复核提醒;插件不会自动下单或改仓位",
8992
"strategy_plugin_name_crisis_response_shadow": "危机观察通知",
9093
"strategy_plugin_name_taco_rebound_shadow": "TACO 抄底观察通知",
9194
"strategy_plugin_mode_shadow": "影子观察",
@@ -100,6 +103,9 @@
100103
"strategy_plugin_action_blocked": "已阻断",
101104
"strategy_plugin_action_monitor": "持续观察",
102105
"strategy_plugin_action_unknown_action": "未知提醒",
106+
"strategy_plugin_guidance_crisis_response_shadow_true_crisis_defend": "优先考虑降低杠杆或清理杠杆仓位,暂停加仓;如需保留风险敞口,先降到可承受的小仓位。",
107+
"strategy_plugin_guidance_crisis_response_shadow_no_action_blocked": "危机路线被风控阻断;先核对数据新鲜度和外部情境,不建议仅凭此条加仓。",
108+
"strategy_plugin_guidance_taco_rebound_shadow_taco_rebound_notify_manual_review": "TACO 仅提示可能的反弹窗口;可考虑小仓位、分批、预设止损/失效条件的人工博弈,不建议一次性满仓。",
103109
"no_trades": "✅ 无需调仓",
104110
"emergency": "🛡️ 金丝雀应急: {n_bad}/4 坏, 全部转入 {safe}",
105111
"quarterly": "📊 季度调仓: 前 {n} 名轮动",
@@ -213,6 +219,9 @@
213219
"strategy_plugin_alert_action": "Notice: {action}",
214220
"strategy_plugin_alert_mode": "Mode: {mode}",
215221
"strategy_plugin_alert_as_of": "Signal as-of: {as_of}",
222+
"strategy_plugin_alert_guidance": "Manual guidance: {guidance}",
223+
"strategy_plugin_alert_scope_note": "Execution scope: {scope_note}",
224+
"strategy_plugin_alert_scope": "Manual review notice only; the plugin does not place orders or change allocations",
216225
"strategy_plugin_name_crisis_response_shadow": "Crisis Watch Notice",
217226
"strategy_plugin_name_taco_rebound_shadow": "TACO Rebound Watch Notice",
218227
"strategy_plugin_mode_shadow": "shadow",
@@ -227,6 +236,9 @@
227236
"strategy_plugin_action_blocked": "blocked",
228237
"strategy_plugin_action_monitor": "watch",
229238
"strategy_plugin_action_unknown_action": "unknown notice",
239+
"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.",
240+
"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.",
241+
"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.",
230242
"no_trades": "✅ No rebalance needed",
231243
"emergency": "🛡️ Canary Emergency: {n_bad}/4 bad, rotating to {safe}",
232244
"quarterly": "📊 Quarterly Rebalance: Top {n} rotation",

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
flask
22
gunicorn
3-
quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@b520bcaa216e36b94ce60c8c6a13f982de826830
3+
quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@f176f5d1f208724381278c253941cbc6d0a1c964
44
us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@6671946c3e5525bf14c19ab03e8b059e4aa0407b
55
pandas
66
numpy

tests/test_notifications.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ def test_build_translator_supports_chinese():
5656
)
5757
== "🧩 插件:TACO 抄底观察通知 | 状态:TACO 反弹确认 | 提醒:通知人工复核"
5858
)
59+
assert translate("strategy_plugin_alert_guidance", guidance="小仓位博弈") == "处置建议:小仓位博弈"
60+
assert translate("strategy_plugin_alert_scope_note", scope_note="不会自动下单") == "执行范围:不会自动下单"
61+
assert "降低杠杆" in translate("strategy_plugin_guidance_crisis_response_shadow_true_crisis_defend")
62+
assert "小仓位" in translate("strategy_plugin_guidance_taco_rebound_shadow_taco_rebound_notify_manual_review")
5963
assert translate("account_ids_detail", account_ids="U18308207") == "🆔 账户: U18308207"
6064
assert (
6165
translate(

0 commit comments

Comments
 (0)