本地手续费配置(标准×2),持仓/交易记录/复盘/统计展示扣费后盈亏
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+38
-5
@@ -9,6 +9,13 @@
|
||||
<div class="stat-item"><div class="label">胜率</div><div class="value">{{ rate }}%</div></div>
|
||||
</div>
|
||||
|
||||
<div class="stat-grid">
|
||||
<div class="stat-item"><div class="label">累计手续费</div><div class="value text-loss">{{ total_fee }} 元</div></div>
|
||||
<div class="stat-item"><div class="label">毛盈亏合计</div><div class="value">{{ total_gross }} 元</div></div>
|
||||
<div class="stat-item"><div class="label">净盈亏合计</div><div class="value {% if total_net > 0 %}text-profit{% elif total_net < 0 %}text-loss{% endif %}">{{ total_net }} 元</div></div>
|
||||
<div class="stat-item"><div class="label">计费笔数</div><div class="value">{{ fee_count }}</div></div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h2>按品种统计</h2>
|
||||
<table>
|
||||
@@ -28,6 +35,24 @@
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h2>手续费按品种(交易记录)</h2>
|
||||
<table>
|
||||
<thead><tr><th>品种</th><th>笔数</th><th>累计手续费(元)</th></tr></thead>
|
||||
<tbody>
|
||||
{% for f in fee_by_symbol %}
|
||||
<tr>
|
||||
<td>{{ f.symbol_name or f.symbol }}</td>
|
||||
<td>{{ f.cnt }}</td>
|
||||
<td class="text-loss">{{ round(f.total_fee, 2) }}</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr><td colspan="3" class="text-muted">暂无手续费数据</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h2>按类型统计</h2>
|
||||
<table>
|
||||
@@ -67,22 +92,30 @@
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h2>最近 10 笔交易</h2>
|
||||
<h2>最近 10 笔交易记录</h2>
|
||||
<table>
|
||||
<thead><tr><th>品种</th><th>方向</th><th>结果</th><th>时间</th></tr></thead>
|
||||
<thead><tr><th>品种</th><th>方向</th><th>毛盈亏</th><th>手续费</th><th>净盈亏</th><th>结果</th><th>时间</th></tr></thead>
|
||||
<tbody>
|
||||
{% for r in recent %}
|
||||
<tr>
|
||||
<td>{{ r.symbol_name or r.symbol }}</td>
|
||||
<td><span class="badge dir">{{ '做多' if r.direction == 'long' else '做空' }}</span></td>
|
||||
<td>{{ r.pnl if r.pnl is not none else '-' }}</td>
|
||||
<td class="text-muted">{{ r.fee if r.fee is not none else '-' }}</td>
|
||||
<td>
|
||||
{% if r.pnl_net and r.pnl_net > 0 %}<span class="badge profit">{{ r.pnl_net }}</span>
|
||||
{% elif r.pnl_net and r.pnl_net < 0 %}<span class="badge loss">{{ r.pnl_net }}</span>
|
||||
{% else %}-{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% if r.result == '止盈' %}<span class="badge profit">止盈</span>
|
||||
{% else %}<span class="badge loss">止损</span>{% endif %}
|
||||
{% elif r.result == '止损' %}<span class="badge loss">止损</span>
|
||||
{% else %}{{ r.result or '-' }}{% endif %}
|
||||
</td>
|
||||
<td>{{ r.created_at[:16] if r.created_at else '' }}</td>
|
||||
<td>{{ r.close_time[:16] if r.close_time else (r.created_at[:16] if r.created_at else '') }}</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr><td colspan="4" class="text-muted">暂无数据</td></tr>
|
||||
<tr><td colspan="7" class="text-muted">暂无数据</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user