Skip to content

Commit 000f89f

Browse files
Pigbibicodex
andcommitted
fix(notify): clarify submitted order is unconfirmed
Co-Authored-By: Codex <noreply@openai.com>
1 parent 6407bb1 commit 000f89f

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

application/execution_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ def check_order_submitted(report, *, translator):
275275
),
276276
)
277277
if status in {"PendingSubmit", "ApiPending", "ApiPendingSubmit", "Submitted", "PreSubmitted"}:
278-
return True, f"✅ {translator('submitted', order_id=order_id)}"
278+
return True, f"✅ {translator('submitted', order_id=order_id, status=status)}"
279279
return False, f"❌ {translator('failed', reason=status)}"
280280

281281

notifications/telegram.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def _break_telegram_market_symbol_auto_links(value) -> str:
211211
"hold": "💎 持仓不变",
212212
"market_sell": "📉 [市价卖出] {symbol}: {qty}股",
213213
"limit_buy": "📈 [限价买入] {symbol}: {qty}股 @ ${price}",
214-
"submitted": "已下发,尚未确认成交;DAY 限价单若收盘未成交会自动取消(订单号: {order_id})",
214+
"submitted": "已下发(状态: {status}),尚未确认券商接受或成交,仍可能被拒单或取消;DAY 限价单若收盘未成交会自动取消(订单号: {order_id})",
215215
"failed": "失败: {reason}",
216216
"order_filled": "✅ 订单成交 | {symbol} {side} {qty}股 均价 ${price}(订单号: {order_id})",
217217
"order_partial": "⚠️ 部分成交 | {symbol} {side} {executed}/{qty}股 均价 ${price}(订单号: {order_id})",
@@ -427,7 +427,7 @@ def _break_telegram_market_symbol_auto_links(value) -> str:
427427
"hold": "💎 Hold positions",
428428
"market_sell": "📉 [Market sell] {symbol}: {qty} shares",
429429
"limit_buy": "📈 [Limit buy] {symbol}: {qty} shares @ ${price}",
430-
"submitted": "submitted, fill not confirmed; a DAY limit order may auto-cancel if unfilled at close (ID: {order_id})",
430+
"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})",
431431
"failed": "failed: {reason}",
432432
"order_filled": "✅ Filled | {symbol} {side} {qty} shares avg ${price} (ID: {order_id})",
433433
"order_partial": "⚠️ Partial | {symbol} {side} {executed}/{qty} shares avg ${price} (ID: {order_id})",

tests/test_execution_service.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ def test_check_order_submitted_warns_submitted_order_is_not_fill_confirmation():
8282
report = SimpleNamespace(broker_order_id="123", status="Submitted")
8383
ok, message = check_order_submitted(report, translator=build_translator("zh"))
8484
assert ok is True
85-
assert "尚未确认成交" in message
85+
assert "状态: Submitted" in message
86+
assert "仍可能被拒单或取消" in message
87+
assert "尚未确认券商接受或成交" in message
8688
assert "自动取消" in message
8789

8890

0 commit comments

Comments
 (0)