Resolve position average entry from CTP trades and PnL instead of stale monitor cache.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-30 09:59:02 +08:00
parent 2f58159372
commit fb23ee891c
3 changed files with 100 additions and 12 deletions
-3
View File
@@ -832,15 +832,12 @@
if (isPhoneLayout() && posMobileCache[key]) {
var cached = posMobileCache[key];
if (q.mark_price != null) cached.current_price = q.mark_price;
if (q.entry_price != null) cached.entry_price = q.entry_price;
if (q.float_pnl != null) cached.float_pnl = q.float_pnl;
}
var row = findPosRow(key);
if (!row) return;
var entryEl = row.querySelector('.dash-p-entry');
var markEl = row.querySelector('.dash-p-mark');
var pnlEl = row.querySelector('.dash-p-pnl');
if (entryEl && q.entry_price != null) entryEl.textContent = fmtNum(q.entry_price);
if (markEl && q.mark_price != null) markEl.textContent = fmtNum(q.mark_price);
if (pnlEl && q.float_pnl != null) {
pnlEl.textContent = fmtPnl(q.float_pnl);