From 9e566935d54ad1413032cb47b1ffe92fa16a5cc5 Mon Sep 17 00:00:00 2001 From: fish Date: Tue, 28 Jul 2026 10:02:57 +0800 Subject: [PATCH] =?UTF-8?q?PNL=E5=BC=B9=E7=AA=97=E6=AF=9B=E5=88=A9?= =?UTF-8?q?=E9=87=91=E9=A2=9D=E6=8C=89=E6=AD=A3=E8=B4=9F=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=BA=A2=E7=BB=BF=E8=89=B2=E5=8F=8A=E6=AD=A3=E8=B4=9F=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.7 --- ft-app/app/templates/trades.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ft-app/app/templates/trades.html b/ft-app/app/templates/trades.html index c1bda20..f05f52a 100644 --- a/ft-app/app/templates/trades.html +++ b/ft-app/app/templates/trades.html @@ -373,7 +373,9 @@ function showPnlDrawer(title, direction, openPrice, closePrice, openFee, closeFe var fees = openFee + closeFee; var html = '项目计算金额'; html += '价差' + (direction === 'short' ? openPrice + ' - ' + closePrice : closePrice + ' - ' + openPrice) + '' + diff.toFixed(2) + ' 点'; - html += '毛利' + diff.toFixed(2) + ' × ' + pointValue + '' + gross.toFixed(2) + ''; + var grossColor = gross > 0 ? 'var(--danger-fg)' : gross < 0 ? 'var(--success-fg)' : 'var(--danger-fg)'; + var grossPrefix = gross > 0 ? '+' : gross < 0 ? '' : ''; + html += '毛利' + diff.toFixed(2) + ' × ' + pointValue + '' + grossPrefix + gross.toFixed(2) + ''; html += '开仓手续费-' + openFee.toFixed(2) + ''; html += '平仓手续费-' + closeFee.toFixed(2) + ''; document.getElementById('pnlTable').innerHTML = html;