feat: archive trades by close time and show open time on live positions

Sort inner-archive daily trades by closed_at_ms; add open time and live hold duration to instance and hub position cards, with exchange margin on hub footer.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-15 06:20:18 +08:00
parent ad1c08a2cc
commit 869728ce10
11 changed files with 230 additions and 7 deletions
+3
View File
@@ -7172,6 +7172,9 @@ def api_price_snapshot():
symbol=r["symbol"],
)
apply_time_close_to_payload(payload, r)
payload["opened_at"] = r["opened_at"] if "opened_at" in r.keys() else None
open_ms = r["opened_at_ms"] if "opened_at_ms" in r.keys() else None
payload["opened_at_ms"] = int(open_ms) if open_ms not in (None, "") else None
new_sl, new_tp, changed = order_monitor_tpsl_needs_sync(
r["stop_loss"], r["take_profit"], exchange_tpsl
)