Show strategy rules in fold; larger nav; notify only when cannot open.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-29 18:12:26 +08:00
parent a5945f0837
commit 71b5fcae79
6 changed files with 76 additions and 12 deletions
+6 -3
View File
@@ -171,13 +171,16 @@ def assess_open_capacity(db: Database | None = None) -> dict[str, Any]:
def maybe_notify_funds_short(cap: dict[str, Any] | None = None) -> None:
"""交易账户资金不足时企业微信推送:不足期间只推一次"""
"""仅在「不能开」时推送一次;能开绝不通知"""
global _notified_while_short
cap = cap or assess_open_capacity()
short = cap.get("perp_can_open") is False or cap.get("option_can_open") is False
if not short:
# 能开 / 未知:不通知;资金恢复则重置,便于下次不足再提醒一次
if cap.get("funds_ok") is True:
_notified_while_short = False
return
cannot = cap.get("perp_can_open") is False or cap.get("option_can_open") is False
if not cannot:
return
if _notified_while_short:
return
_notified_while_short = True