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 @@
{{ pc }} · {{ trades|length }} 笔
{% endif %} - + {% for t in trades %} @@ -215,6 +215,16 @@ +
合约方向开仓平仓持仓开仓价平仓价开仓费平仓费盈亏操作
合约方向开仓平仓持仓开仓价平仓价开仓费平仓费平仓盈亏盈亏操作
{{ t.contract_code.replace(t.product_code, '', 1) }}{{ 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 %}