diff --git a/ft-app/app/templates/trades.html b/ft-app/app/templates/trades.html index e76bff4..8cef70e 100644 --- a/ft-app/app/templates/trades.html +++ b/ft-app/app/templates/trades.html @@ -197,7 +197,7 @@
| 合约 | 方向 | 开仓 | 平仓 | 持仓 | 开仓价 | 平仓价 | 开仓费 | 平仓费 | 盈亏 | 操作 | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 合约 | 方向 | 开仓 | 平仓 | 持仓 | 开仓价 | 平仓价 | 开仓费 | 平仓费 | 平仓盈亏 | 盈亏 | 操作 |
| {{ t.contract_code.replace(t.product_code, '', 1) }} | @@ -215,6 +215,16 @@{{ t.close_price }} | {{ t.open_fee or 0 }} | {{ t.close_fee or 0 }} | ++ {% if t.direction == 'short' %} + {% set gross_pnl = (t.open_price - t.close_price) * t.point_value %} + {% else %} + {% set gross_pnl = (t.close_price - t.open_price) * t.point_value %} + {% endif %} + + {% if gross_pnl > 0 %}+{% endif %}{{ '%.2f'|format(gross_pnl) }} + + | {% set p = t.pnl %} {% if p is not none %} |