fix: show limit-order gate for false breakout monitors
False breakout used box/convergence volume/break gates in the UI; now shows pending limit order status like fib monitors. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -117,3 +117,29 @@ def expires_at_text(created_at: Any, *, hours: int = FALSE_BREAKOUT_VALIDITY_HOU
|
||||
if dt is None:
|
||||
return "—"
|
||||
return (dt + timedelta(hours=hours)).strftime("%Y-%m-%d %H:%M:%S")
|
||||
|
||||
|
||||
def false_breakout_gate_preview(
|
||||
*,
|
||||
entry_display: str,
|
||||
limit_order_id: Any = None,
|
||||
created_at: Any = None,
|
||||
now: Optional[datetime] = None,
|
||||
hours: int = FALSE_BREAKOUT_VALIDITY_HOURS,
|
||||
) -> dict[str, Any]:
|
||||
"""假突破门控预览:限价挂单状态,不使用箱体/收敛的量破幅二确门控。"""
|
||||
now_dt = now or datetime.now()
|
||||
expired = is_false_breakout_expired(created_at, now_dt, hours=hours)
|
||||
exp_txt = expires_at_text(created_at, hours=hours)
|
||||
status = "已过期" if expired else "等待成交"
|
||||
metrics_parts: list[str] = []
|
||||
oid = str(limit_order_id or "").strip()
|
||||
if oid:
|
||||
metrics_parts.append(f"限价单:{oid}")
|
||||
if exp_txt != "—":
|
||||
metrics_parts.append(f"截至:{exp_txt}")
|
||||
return {
|
||||
"summary": f"假突破 挂E={entry_display} {status}",
|
||||
"metrics": " ".join(metrics_parts),
|
||||
"gate_ok": not expired,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user