{# Hub iframe tab fragment — shared via embed_templates #} {% macro period_stats_pane(period_key, s) %} {% set win_pct = s.win_rate_pct if s.win_rate_pct is not none else 0 %} {% set profit_sum = (s.net_pnl_u + s.loss_sum_u) if s.closed_count else 0 %} {% set loss_sum = s.loss_sum_u %} {% set pnl_total = profit_sum + loss_sum %} {% set profit_bar_w = (profit_sum / pnl_total * 100) if pnl_total > 0 else 0 %} {% set loss_bar_w = (loss_sum / pnl_total * 100) if pnl_total > 0 else 0 %} {% set net_cls = 'pos-pnl-profit' if s.net_pnl_u > 0 else ('pos-pnl-loss' if s.net_pnl_u < 0 else '') %}
{{ s.range_label }}
{% if s.closed_count %}
{% if s.net_pnl_u > 0 %}+{% endif %}{{ funds_fmt(s.net_pnl_u) }}U 净盈亏
{% if s.win_rate_pct is not none %}{{ win_pct|round(0)|int }}%{% else %}—{% endif %}
{{ s.win_count }}胜 {{ s.loss_count }}负
{{ s.opens_count }} / {{ s.closed_count }} 开单 / 平仓
盈亏构成
盈利 {{ funds_fmt(profit_sum) }}U 亏损 {{ funds_fmt(loss_sum) }}U
最大回撤 {{ funds_fmt(s.max_drawdown_u) }}U
连续亏损 {{ s.consecutive_losses }} 笔
最长连亏日 {{ s.max_loss_streak_days }} 天
最大亏损日 {% if s.worst_day %}{{ s.worst_day }} ({{ funds_fmt(s.worst_day_pnl) }}U){% else %}—{% endif %}
{% else %}

当前区间暂无平仓数据

{% endif %}
详细指标
开单次数
{{ s.opens_count }}
平仓笔数
{{ s.closed_count }}
胜率
{% if s.win_rate_pct is not none %}{{ s.win_rate_pct }}%{% else %}-{% endif %}
净盈亏(U)
{{ funds_fmt(s.net_pnl_u) }}
亏损额合计(U)
{{ funds_fmt(s.loss_sum_u) }}
单笔最大亏损(U)
{% if s.max_single_loss is not none %}{{ funds_fmt(s.max_single_loss) }}{% else %}-{% endif %}
单笔最大盈利(U)
{% if s.max_single_profit is not none %}{{ funds_fmt(s.max_single_profit) }}{% else %}-{% endif %}
最大回撤(U)
{{ funds_fmt(s.max_drawdown_u) }}
当前连续亏损笔数
{{ s.consecutive_losses }}
最长连续亏损(交易日)
{{ s.max_loss_streak_days }} 天
期内最大亏损日
{% if s.worst_day %}{{ s.worst_day }}({{ funds_fmt(s.worst_day_pnl) }}U){% else %}-{% endif %}
{% if period_key == 'all' %}
按月统计
{% if s.monthly_rows %}
{% for m in s.monthly_rows %} {% set m_net_cls = 'pos-pnl-profit' if m.net_pnl_u > 0 else ('pos-pnl-loss' if m.net_pnl_u < 0 else '') %} {% endfor %}
月份 开单 平仓 胜率 净盈亏 最大回撤
{{ m.month_key }} {{ m.opens_count }} {{ m.closed_count }} {% if m.win_rate_pct is not none %}{{ m.win_rate_pct }}%{% else %}—{% endif %} {% if m.net_pnl_u > 0 %}+{% endif %}{{ funds_fmt(m.net_pnl_u) }} {{ funds_fmt(m.max_drawdown_u) }}
{% else %}

暂无按月平仓数据

{% endif %}
{% endif %}
{% endmacro %}
{% if page == 'dashboard' %} {% include 'dashboard_panel.html' %} {% elif page == 'account_ledger' %} {% include 'account_ledger_panel.html' %} {% elif page == 'key_monitor' %} {% include 'key_monitor_panel.html' %} {% elif page == 'options' %} {% include 'options_panel.html' %} {% elif page == 'options_review' %} {% include 'options_review_panel.html' %} {% elif page == 'hedge_plan' %} {% include 'hedge_plan_panel.html' %} {% endif %} {% if page == 'env_config' %} {% include 'env_config_panel.html' %} {% endif %} {% if page == 'risk_policy' %} {% include 'risk_policy_panel.html' %} {% endif %} {% if page == 'system_guide' %} {% include 'system_guide_panel.html' %} {% endif %} {% if page == 'settings' %} {% include 'settings_panel.html' %} {% endif %}