调整平仓盈亏列位置至平仓价与开仓费之间

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
fish
2026-07-28 09:57:12 +08:00
parent 0fcc7eea03
commit 41c149a6ee
+3 -3
View File
@@ -197,7 +197,7 @@
<div class="section-title" style="font-size:0.88rem;margin-bottom:0;padding:6px 12px;">{{ pc }} · {{ trades|length }} 笔</div> <div class="section-title" style="font-size:0.88rem;margin-bottom:0;padding:6px 12px;">{{ pc }} · {{ trades|length }} 笔</div>
{% endif %} {% endif %}
<table> <table>
<tr><th>合约</th><th>方向</th><th>开仓</th><th>平仓</th><th>持仓</th><th>开仓价</th><th>平仓价</th><th>开仓费</th><th>平仓费</th><th>平仓盈亏</th><th>盈亏</th><th>操作</th></tr> <tr><th>合约</th><th>方向</th><th>开仓</th><th>平仓</th><th>持仓</th><th>开仓价</th><th>平仓价</th><th>平仓盈亏</th><th>开仓费</th><th>平仓费</th><th>盈亏</th><th>操作</th></tr>
{% for t in trades %} {% for t in trades %}
<tr> <tr>
<td><strong>{{ t.contract_code.replace(t.product_code, '', 1) }}</strong></td> <td><strong>{{ t.contract_code.replace(t.product_code, '', 1) }}</strong></td>
@@ -213,8 +213,6 @@
<td>{{ (t.close_date - t.open_date).days }}天</td> <td>{{ (t.close_date - t.open_date).days }}天</td>
<td>{{ t.open_price }}</td> <td>{{ t.open_price }}</td>
<td>{{ t.close_price }}</td> <td>{{ t.close_price }}</td>
<td>{{ t.open_fee or 0 }}</td>
<td>{{ t.close_fee or 0 }}</td>
<td> <td>
{% if t.direction == 'short' %} {% if t.direction == 'short' %}
{% set gross_pnl = (t.open_price - t.close_price) * t.point_value %} {% set gross_pnl = (t.open_price - t.close_price) * t.point_value %}
@@ -225,6 +223,8 @@
{% if gross_pnl > 0 %}+{% endif %}{{ '%.2f'|format(gross_pnl) }} {% if gross_pnl > 0 %}+{% endif %}{{ '%.2f'|format(gross_pnl) }}
</span> </span>
</td> </td>
<td>{{ t.open_fee or 0 }}</td>
<td>{{ t.close_fee or 0 }}</td>
<td> <td>
{% set p = t.pnl %} {% set p = t.pnl %}
{% if p is not none %} {% if p is not none %}