Show trade open/close times and hold period by target exit.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-27 15:37:37 +08:00
parent 0e3a8b08ec
commit 14c6ba51a8
9 changed files with 279 additions and 30 deletions
+4 -2
View File
@@ -729,10 +729,11 @@ class Matcher:
),
)
self.db._conn.execute(
"""UPDATE groups SET status=?, close_reason=?, realized_pnl=?,
"""UPDATE groups SET status=?, close_at_ms=?, close_reason=?, realized_pnl=?,
fees=?, slip_cost=?, note=? WHERE group_id=?""",
(
"option_residual",
now,
reason,
interim_net,
fees,
@@ -898,7 +899,8 @@ class Matcher:
),
)
self.db._conn.execute(
"""UPDATE groups SET status=?, close_at_ms=?, realized_pnl=?, fees=?, slip_cost=?
"""UPDATE groups SET status=?, close_at_ms=COALESCE(close_at_ms, ?),
realized_pnl=?, fees=?, slip_cost=?
WHERE group_id=?""",
("closed", now_ms, float(net), fees, slip, group_id),
)