Fix breakeven badge still showing after roll lowers stop loss.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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"]),
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user