{% extends "base.html" %} {% block title %}仓位管理{% endblock %} {% block heading %}仓位管理{% endblock %} {% block breadcrumb %}振幅锁仓 · 仓位跟踪{% endblock %} {% block content %} {% set error = request.query_params.get('error', '') %} {% if error %}
{{ error }}
{% endif %} {% if not active_round %} {# ═══════════════ 新建轮次 ═══════════════ #}
新建轮次

暂无活跃轮次

创建一轮新的交易,开始跟踪仓位和锁仓状态

{% else %} {# ═══════════════ 活跃轮次信息 ═══════════════ #} {% set locks = active_round.total_locks %}
合约
{{ active_round.contract_code }}
每日手数
{{ active_round.daily_hands }} 手/天
已开仓天数
{{ active_round.positions|length }} 天
累计锁仓
{{ locks }} / 3 {% if locks >= 3 %}⚠ 熔断{% endif %}
开始日期
{{ active_round.started_at }}
{# ═══════════════ 止盈阈值提示 ═══════════════ #} {% if active_round.positions|length > 0 %} {% set latest = active_round.positions[-1] %}
止盈阈值 {{ active_round.daily_hands }} × {{ latest.amp_threshold }} = {{ active_round.daily_hands * latest.amp_threshold }} 点
当前振幅 A {{ latest.amp_threshold }} 点
总手数 {{ active_round.daily_hands * active_round.positions|length }}
{% endif %} {# ═══════════════ 添加仓位 ═══════════════ #}
添加当日仓位
锁仓价位
{# ═══════════════ 仓位列表 ═══════════════ #}
本轮仓位
{% if active_round.positions %}
{% for p in active_round.positions|reverse %} {% endfor %}
日期 开仓价 振幅 A 锁仓价位 手数 已锁 状态 操作
{{ p.opened_at }} {{ p.open_price }} {{ p.amp_threshold }} {{ p.lock_price }} {{ p.hands }} {% if p.locked_count > 0 %} {{ p.locked_count }}/{{ p.hands }} {% else %} 0/{{ p.hands }} {% endif %} {% if p.locked_count >= p.hands %} 已全锁 {% elif p.locked_count > 0 %} 部分锁仓 {% else %} 活跃 {% endif %}
{% else %}
暂无仓位,请添加当日仓位。
{% endif %} {# ═══════════════ 结束轮次 ═══════════════ #}
结束本轮:
{% endif %} {% endblock %}