Align trade record verify/edit UX with Binance instance single-row prompts.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-30 22:02:48 +08:00
parent b6b7bfb248
commit 32838daae0
5 changed files with 259 additions and 139 deletions
+12 -1
View File
@@ -1328,6 +1328,17 @@ def update_trade(tid):
fee = calc["fee"]
pnl_net = calc["pnl_net"]
form_pnl_raw = d.get("pnl")
if form_pnl_raw not in (None, ""):
pnl = float(form_pnl_raw)
pnl_net = round(pnl - fee, 2)
try:
from app import holding_to_minutes
minutes = int(holding_to_minutes(open_time, close_time) or 0)
except Exception:
minutes = int(d.get("holding_minutes") or row.get("holding_minutes") or 0)
conn.execute(
"""UPDATE trade_logs SET
symbol_name=?, monitor_type=?, direction=?,
@@ -1345,7 +1356,7 @@ def update_trade(tid):
close_px,
lots,
float(d.get("margin") or 0),
int(d.get("holding_minutes") or 0),
minutes,
open_time,
close_time,
pnl,