Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions notifications/telegram.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
"blend_gate_reason_bollinger_cap": "突破布林上轨",
"blend_gate_reason_volatility_delever": "{symbol} {window} 日年化波动率 {volatility} 高于 {threshold},SOXL 转向 {redirect_symbol}",
"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}",
Expand All @@ -87,12 +87,15 @@
"strategy_plugin_alert_mode": "模式:{mode}",
"strategy_plugin_alert_as_of": "信号时间:{as_of}",
"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": "持续观察",
Expand Down Expand Up @@ -201,8 +204,8 @@
"blend_gate_reason_bollinger_cap": "price above upper band",
"blend_gate_reason_volatility_delever": "{symbol} {window}d annualized volatility {volatility} is above {threshold}; redirect SOXL to {redirect_symbol}",
"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}",
Expand All @@ -211,12 +214,15 @@
"strategy_plugin_alert_mode": "Mode: {mode}",
"strategy_plugin_alert_as_of": "Signal as-of: {as_of}",
"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",
Expand Down
12 changes: 11 additions & 1 deletion tests/test_notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,17 @@ def test_build_translator_supports_chinese():
route=translate("strategy_plugin_route_no_action"),
action=translate("strategy_plugin_action_watch_only"),
)
== "🧩 插件:危机观察通知 | 状态:未触发危机 | 提醒:仅通知"
== "🧩 插件:危机观察通知 | 状态:未触发 | 提醒:仅通知"
)
assert (
translate(
"strategy_plugin_line",
plugin=translate("strategy_plugin_name_taco_rebound_shadow"),
mode=translate("strategy_plugin_mode_shadow"),
route=translate("strategy_plugin_route_taco_rebound"),
action=translate("strategy_plugin_action_notify_manual_review"),
)
== "🧩 插件:TACO 抄底观察通知 | 状态:TACO 反弹确认 | 提醒:通知人工复核"
)
assert translate("account_ids_detail", account_ids="U18308207") == "🆔 账户: U18308207"
assert (
Expand Down