Skip to content

Commit 2dc1b1d

Browse files
authored
Use localized strategy plugin alert copy (#35)
1 parent 4443fec commit 2dc1b1d

3 files changed

Lines changed: 19 additions & 5 deletions

File tree

notifications/telegram.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,17 @@
3939
"strategy_plugin_line": "🧩 插件:{plugin} | 状态:{route} | 提醒:{action}",
4040
"strategy_plugin_alert_subject": "🚨 危机插件告警:{plugin} | {route}",
4141
"strategy_plugin_alert_title": "🚨 【危机插件告警】",
42+
"strategy_plugin_alert_context": "运行环境:{context}",
4243
"strategy_plugin_alert_strategy": "策略:{strategy}",
44+
"strategy_plugin_alert_plugin": "插件:{plugin}",
45+
"strategy_plugin_alert_status": "状态:{route}",
46+
"strategy_plugin_alert_action": "提醒:{action}",
47+
"strategy_plugin_alert_mode": "模式:{mode}",
4348
"strategy_plugin_alert_as_of": "信号时间:{as_of}",
44-
"strategy_plugin_alert_would_trade": "若启用交易会操作:{value}",
49+
"strategy_plugin_alert_would_trade": "启用时是否会交易:{value}",
4550
"strategy_plugin_alert_source": "来源:{source}",
51+
"strategy_plugin_alert_yes": "是",
52+
"strategy_plugin_alert_no": "否",
4653
"strategy_plugin_name_crisis_response_shadow": "危机观察通知",
4754
"strategy_plugin_mode_shadow": "影子观察",
4855
"strategy_plugin_route_no_action": "未触发危机",
@@ -139,10 +146,17 @@
139146
"strategy_plugin_line": "🧩 Plugin: {plugin} | status: {route} | notice: {action}",
140147
"strategy_plugin_alert_subject": "🚨 Crisis plugin alert: {plugin} | {route}",
141148
"strategy_plugin_alert_title": "🚨 【Crisis Plugin Alert】",
149+
"strategy_plugin_alert_context": "Context: {context}",
142150
"strategy_plugin_alert_strategy": "Strategy: {strategy}",
151+
"strategy_plugin_alert_plugin": "Plugin: {plugin}",
152+
"strategy_plugin_alert_status": "Status: {route}",
153+
"strategy_plugin_alert_action": "Notice: {action}",
154+
"strategy_plugin_alert_mode": "Mode: {mode}",
143155
"strategy_plugin_alert_as_of": "Signal as-of: {as_of}",
144156
"strategy_plugin_alert_would_trade": "Would trade if enabled: {value}",
145157
"strategy_plugin_alert_source": "Source: {source}",
158+
"strategy_plugin_alert_yes": "yes",
159+
"strategy_plugin_alert_no": "no",
146160
"strategy_plugin_name_crisis_response_shadow": "Crisis Watch Notice",
147161
"strategy_plugin_mode_shadow": "shadow",
148162
"strategy_plugin_route_no_action": "no crisis detected",

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ authors = [
1414
]
1515
dependencies = [
1616
"firstrade==0.0.38",
17-
"quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@532346b6e22d9f9c0a25c5e859f29084d7b27f6c",
18-
"us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@7ccc46038e6f0fe84a6910a6fa0515252bf15b79",
17+
"quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@a65f589b410cda42f165e3242328763567766b84",
18+
"us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@edf563df5fe4f13ef2d236cd0c8b823f9ef437ea",
1919
"google-cloud-storage",
2020
"requests",
2121
]

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
flask
22
gunicorn
33
firstrade==0.0.38
4-
quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@532346b6e22d9f9c0a25c5e859f29084d7b27f6c
5-
us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@7ccc46038e6f0fe84a6910a6fa0515252bf15b79
4+
quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@a65f589b410cda42f165e3242328763567766b84
5+
us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@edf563df5fe4f13ef2d236cd0c8b823f9ef437ea
66
google-cloud-storage
77
requests
88
pytest

0 commit comments

Comments
 (0)