diff --git a/application/execution_service.py b/application/execution_service.py index 63b99e4..b3da915 100644 --- a/application/execution_service.py +++ b/application/execution_service.py @@ -275,7 +275,7 @@ def check_order_submitted(report, *, translator): ), ) if status in {"PendingSubmit", "ApiPending", "ApiPendingSubmit", "Submitted", "PreSubmitted"}: - return True, f"✅ {translator('submitted', order_id=order_id)}" + return True, f"✅ {translator('submitted', order_id=order_id, status=status)}" return False, f"❌ {translator('failed', reason=status)}" diff --git a/notifications/telegram.py b/notifications/telegram.py index e0b5fb5..e489d6e 100644 --- a/notifications/telegram.py +++ b/notifications/telegram.py @@ -211,7 +211,7 @@ def _break_telegram_market_symbol_auto_links(value) -> str: "hold": "💎 持仓不变", "market_sell": "📉 [市价卖出] {symbol}: {qty}股", "limit_buy": "📈 [限价买入] {symbol}: {qty}股 @ ${price}", - "submitted": "已下发,尚未确认成交;DAY 限价单若收盘未成交会自动取消(订单号: {order_id})", + "submitted": "已下发(状态: {status}),尚未确认券商接受或成交,仍可能被拒单或取消;DAY 限价单若收盘未成交会自动取消(订单号: {order_id})", "failed": "失败: {reason}", "order_filled": "✅ 订单成交 | {symbol} {side} {qty}股 均价 ${price}(订单号: {order_id})", "order_partial": "⚠️ 部分成交 | {symbol} {side} {executed}/{qty}股 均价 ${price}(订单号: {order_id})", @@ -427,7 +427,7 @@ def _break_telegram_market_symbol_auto_links(value) -> str: "hold": "💎 Hold positions", "market_sell": "📉 [Market sell] {symbol}: {qty} shares", "limit_buy": "📈 [Limit buy] {symbol}: {qty} shares @ ${price}", - "submitted": "submitted, fill not confirmed; a DAY limit order may auto-cancel if unfilled at close (ID: {order_id})", + "submitted": "submitted (status: {status}), but broker acceptance/fill is not confirmed and the order may still be rejected or cancelled; a DAY limit order may auto-cancel if unfilled at close (ID: {order_id})", "failed": "failed: {reason}", "order_filled": "✅ Filled | {symbol} {side} {qty} shares avg ${price} (ID: {order_id})", "order_partial": "⚠️ Partial | {symbol} {side} {executed}/{qty} shares avg ${price} (ID: {order_id})", diff --git a/pyproject.toml b/pyproject.toml index 0d2b82c..1b416a0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ dependencies = [ "google-cloud-secret-manager", "google-cloud-storage", "yfinance", - "quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@f6d5c2c64d2b0dcd2e16a8bb2093e737a281d305", + "quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@69a0256934d081b5ef309a885384b9eb9f62cf90", "us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@17ddb86c72d44b2c7b78ba7a10d8f71b21180166", "hk-equity-strategies @ git+https://github.com/QuantStrategyLab/HkEquityStrategies.git@b6a8ac2ad3c8110b5ea74fb059c8206388d63bcd", ] @@ -64,5 +64,5 @@ include = [ [tool.uv] override-dependencies = [ - "quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@f6d5c2c64d2b0dcd2e16a8bb2093e737a281d305", + "quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@69a0256934d081b5ef309a885384b9eb9f62cf90", ] diff --git a/qsl.toml b/qsl.toml index a01b2b4..1f8f846 100644 --- a/qsl.toml +++ b/qsl.toml @@ -5,7 +5,7 @@ ring = 3 allow_legacy = false [qsl.requires] -quant_platform_kit = "f6d5c2c64d2b0dcd2e16a8bb2093e737a281d305" +quant_platform_kit = "69a0256934d081b5ef309a885384b9eb9f62cf90" us_equity_strategies = "17ddb86c72d44b2c7b78ba7a10d8f71b21180166" hk_equity_strategies = "b6a8ac2ad3c8110b5ea74fb059c8206388d63bcd" diff --git a/tests/test_execution_service.py b/tests/test_execution_service.py index 66408db..3a943fa 100644 --- a/tests/test_execution_service.py +++ b/tests/test_execution_service.py @@ -82,7 +82,9 @@ def test_check_order_submitted_warns_submitted_order_is_not_fill_confirmation(): report = SimpleNamespace(broker_order_id="123", status="Submitted") ok, message = check_order_submitted(report, translator=build_translator("zh")) assert ok is True - assert "尚未确认成交" in message + assert "状态: Submitted" in message + assert "仍可能被拒单或取消" in message + assert "尚未确认券商接受或成交" in message assert "自动取消" in message diff --git a/uv.lock b/uv.lock index 192ffac..03f330c 100644 --- a/uv.lock +++ b/uv.lock @@ -17,7 +17,7 @@ resolution-markers = [ ] [manifest] -overrides = [{ name = "quant-platform-kit", git = "https://github.com/QuantStrategyLab/QuantPlatformKit.git?rev=f6d5c2c64d2b0dcd2e16a8bb2093e737a281d305" }] +overrides = [{ name = "quant-platform-kit", git = "https://github.com/QuantStrategyLab/QuantPlatformKit.git?rev=69a0256934d081b5ef309a885384b9eb9f62cf90" }] [[package]] name = "beautifulsoup4" @@ -791,7 +791,7 @@ requires-dist = [ { name = "pytest", marker = "extra == 'test'" }, { name = "pytest-cov", marker = "extra == 'test'" }, { name = "pytz" }, - { name = "quant-platform-kit", git = "https://github.com/QuantStrategyLab/QuantPlatformKit.git?rev=f6d5c2c64d2b0dcd2e16a8bb2093e737a281d305" }, + { name = "quant-platform-kit", git = "https://github.com/QuantStrategyLab/QuantPlatformKit.git?rev=69a0256934d081b5ef309a885384b9eb9f62cf90" }, { name = "requests" }, { name = "ruff", marker = "extra == 'test'" }, { name = "us-equity-strategies", git = "https://github.com/QuantStrategyLab/UsEquityStrategies.git?rev=17ddb86c72d44b2c7b78ba7a10d8f71b21180166" }, @@ -1327,7 +1327,7 @@ wheels = [ [[package]] name = "quant-platform-kit" version = "0.10.0" -source = { git = "https://github.com/QuantStrategyLab/QuantPlatformKit.git?rev=f6d5c2c64d2b0dcd2e16a8bb2093e737a281d305#f6d5c2c64d2b0dcd2e16a8bb2093e737a281d305" } +source = { git = "https://github.com/QuantStrategyLab/QuantPlatformKit.git?rev=69a0256934d081b5ef309a885384b9eb9f62cf90#69a0256934d081b5ef309a885384b9eb9f62cf90" } [[package]] name = "requests"