Fix breakeven badge still showing after roll lowers stop loss.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-10 16:52:29 +08:00
parent edfe935fb4
commit 02472f19cb
10 changed files with 161 additions and 17 deletions
+2 -1
View File
@@ -507,7 +507,8 @@ def _roll_execute(cfg: dict, data: dict) -> tuple[bool, str]:
live_qty = normalize_contracts_qty(live_qty)
conn.execute(
"UPDATE order_monitors SET stop_loss=?, order_amount=? WHERE id=?",
"""UPDATE order_monitors SET stop_loss=?, order_amount=?,
breakeven_armed=0, breakeven_price=NULL WHERE id=?""",
(new_sl, live_qty, mon["id"]),
)
conn.commit()
+3 -1
View File
@@ -459,7 +459,9 @@ def _execute_pending_roll_leg(
except Exception:
pass
conn.execute(
"UPDATE order_monitors SET stop_loss=?, order_amount=? WHERE id=? AND status='active'",
"""UPDATE order_monitors SET stop_loss=?, order_amount=?,
breakeven_armed=0, breakeven_price=NULL
WHERE id=? AND status='active'""",
(sl, live_qty, mon["id"]),
)