{% extends "base.html" %} {% block title %}交易记录{% endblock %} {% block heading %}交易记录{% endblock %} {% block breadcrumb %}开平仓记录 · 盈亏统计{% endblock %} {% block content %} {# ═══════════════ 新建开仓 ═══════════════ #}
新建开仓
{# ═══════════════ 持仓中 ═══════════════ #}
持仓中 · {{ open_trades|length }} 笔
{% if open_trades %}
{% for t in open_trades %} {% endfor %}
品种合约方向开仓日期开仓价手续费操作
{{ t.product_code }} {{ t.contract_code }} {% if t.direction == 'short' %} {% else %} {% endif %} {{ t.open_date }} {{ t.open_price }} {{ t.open_fee or 0 }}
{% else %}
暂无持仓
{% endif %} {# ═══════════════ 平仓表单(隐藏) ═══════════════ #} {# ═══════════════ 已平仓 ═══════════════ #} {% if closed_trades %}
已平仓 · {{ closed_trades|length }} 笔
{% for t in closed_trades %} {% endfor %}
品种合约方向开仓平仓开仓价平仓价盈亏操作
{{ t.product_code }} {{ t.contract_code }} {% if t.direction == 'short' %} {% else %} {% endif %} {{ t.open_date }} {{ t.close_date }} {{ t.open_price }} {{ t.close_price }} {% set p = t.pnl %} {% if p is not none %} {% if p > 0 %}+{% endif %}{{ p }} {% endif %}
{% endif %} {% endblock %}