From f34c16bf7d5d226d287b749a87cc4a24fe447187 Mon Sep 17 00:00:00 2001 From: Pigbibi <20649888+Pigbibi@users.noreply.github.com> Date: Sat, 25 Apr 2026 11:42:47 +0800 Subject: [PATCH] Enable SOXL overlay live defaults on LongBridge --- notifications/telegram.py | 8 ++++++++ requirements.txt | 4 ++-- tests/test_notifications.py | 14 ++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/notifications/telegram.py b/notifications/telegram.py index 8edcf2a..1d75da2 100644 --- a/notifications/telegram.py +++ b/notifications/telegram.py @@ -83,6 +83,10 @@ "market_status_blend_gate_defensive": "🛡️ 降杠杆({asset})", "signal_blend_gate_risk_on": "{trend_symbol} 站上 {window} 日门槛线,持有 SOXL {soxl_ratio} + SOXX {soxx_ratio}", "signal_blend_gate_defensive": "{trend_symbol} 跌破门槛线,防守持有 SOXX {soxx_ratio}", + "market_status_blend_gate_overlay_capped": "🧯 过热降档({asset})", + "signal_blend_gate_overlay_capped": "{trend_symbol} 仍在 {window} 日门槛线上方,但触发过热降档({reasons}),目标仓位 {allocation_text}", + "blend_gate_reason_rsi_cap": "RSI 超阈值", + "blend_gate_reason_bollinger_cap": "突破布林上轨", "signal_hold": "趋势持有", "signal_entry": "入场信号", "signal_reduce": "减仓信号", @@ -165,6 +169,10 @@ "market_status_blend_gate_defensive": "🛡️ DE-LEVER ({asset})", "signal_blend_gate_risk_on": "{trend_symbol} above {window}d gated entry, hold SOXL {soxl_ratio} + SOXX {soxx_ratio}", "signal_blend_gate_defensive": "{trend_symbol} below gated entry, hold defensive SOXX {soxx_ratio}", + "market_status_blend_gate_overlay_capped": "🧯 HEAT-CAP ({asset})", + "signal_blend_gate_overlay_capped": "{trend_symbol} stays above the {window}d gate, but overlay cap ({reasons}) cuts exposure to {allocation_text}", + "blend_gate_reason_rsi_cap": "RSI over threshold", + "blend_gate_reason_bollinger_cap": "price above upper band", "signal_hold": "Trend Hold", "signal_entry": "Entry Signal", "signal_reduce": "Reduce Signal", diff --git a/requirements.txt b/requirements.txt index 569ddc1..e1fe0c7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ flask gunicorn -quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@c24d4c52e84c8c696006532590b15e9be92c8d89 -us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@fcffc7e3901089ddc10e161d4e5703417c0a03d3 +quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@e8ef5e7f9086ab1ca7a0f9b8cff69284d51b96d2 +us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@5e23d6d84d4e53ea95db849084c2d669729309af pandas requests pytz diff --git a/tests/test_notifications.py b/tests/test_notifications.py index 298f95a..cd80fca 100644 --- a/tests/test_notifications.py +++ b/tests/test_notifications.py @@ -47,6 +47,20 @@ def test_build_translator_supports_chinese(self): ), "SOXX 站上 140 日门槛线,持有 SOXL 70.0% + SOXX 20.0%", ) + self.assertEqual( + translate("market_status_blend_gate_overlay_capped", asset="SOXX"), + "🧯 过热降档(SOXX)", + ) + self.assertEqual( + translate( + "signal_blend_gate_overlay_capped", + trend_symbol="SOXX", + window=140, + reasons="RSI 超阈值 + 突破布林上轨", + allocation_text="SOXX 15.0%", + ), + "SOXX 仍在 140 日门槛线上方,但触发过热降档(RSI 超阈值 + 突破布林上轨),目标仓位 SOXX 15.0%", + ) self.assertEqual( translate( "small_account_warning_note",