{# 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 %}
{% endmacro %}
{% if page == 'key_monitor' %} {% include 'key_monitor_panel.html' %} {% elif page == 'trade' %}

实盘下单监控

{% if focus_order_id %} 放大查看K线(100根) {% else %} 暂无持仓可放大 {% endif %}
{% include order_rule_tips_tpl %}
{% from 'trade_policy_fields.html' import trade_policy_symbol, trade_policy_direction with context %} {{ trade_policy_symbol('symbol', 'order-symbol') }} {{ trade_policy_direction('direction', 'order-direction') }} {% from 'order_entry_model_fields.html' import order_entry_type_fields with context %} {{ order_entry_type_fields() }} {% from 'order_leverage_fields.html' import order_leverage_fields with context %} {{ order_leverage_fields() }} {% if not intraday_discipline %} {% else %} {% endif %} {% from 'symbol_live_price_snippet.html' import symbol_live_price_hint %} {{ symbol_live_price_hint('order-symbol-live-price', 'order-symbol', 'order-direction') }} 下单成交价以交易所成交回报为准
{% include 'order_plan_preview_bar.html' %}

实时持仓

{% if ui_orphan_recovery_enabled %} {% if not order and orphan_live_positions %} {% set o = orphan_live_positions[0] %}
检测到交易所仍有 {{ o.symbol }} {{ '空' if o.direction == 'short' else '多' }}仓,但本地监控已中断(误同步时可能无交易记录). {% if o.recoverable_monitor_id %} {% else %} 未找到可恢复的监控记录,需在服务器数据库处理. {% endif %}
{% else %} {% endif %} {% endif %}
{% for o in order %}
{{ o.exchange_symbol or o.symbol }} {% if o.time_close_enabled %} 时间平仓 {{ o.time_close_hours or '' }}h · --:--:-- {% endif %} {% include 'force_close_order_badge.html' %} {{ '做多' if o.direction == 'long' else '做空' }}
{% if not intraday_discipline %} 平仓 {% endif %}
来源: {{ o.monitor_type|default('下单监控', true) }}{% if o.key_signal_type %} · {{ o.key_signal_type }}{% endif %} {% if o.entry_model_label %}开仓: {{ o.entry_model_label }}{% elif intraday_discipline %}开仓: —{% else %}风格: {{ '波段单' if o.trade_style == 'swing' else '趋势单' }}{% endif %} 风险: {% if position_sizing_mode == 'full_margin' %}{{ funds_fmt(o.risk_amount) if o.risk_amount is not none else '-' }}U{% else %}{{ o.risk_percent or '-' }}%≈{{ funds_fmt(o.risk_amount) if o.risk_amount is not none else '-' }}U{% endif %} {% if intraday_discipline %} {% elif o.breakeven_enabled %}移动保本:开 {{ o.breakeven_rr_trigger or '-' }}R→{{ price_fmt(o.symbol, o.breakeven_price) }}{% else %}移动保本:关{% endif %}
成交价 {{ price_fmt(o.symbol, o.trigger_price) }}
止损 {{ price_fmt(o.symbol, o.stop_loss) if o.stop_loss else '—' }}
止盈 {{ price_fmt(o.symbol, o.take_profit) if o.take_profit else '—' }}
盈亏比 {% if o.rr_ratio is not none %}{{ '%g'|format(o.rr_ratio) }}:1{% else %}-:1{% endif %}
张数 {% if o.order_amount is not none %}{{ '%.2f'|format(o.order_amount) }}{% else %}—{% endif %}
盈利金额
标记价 -
浮盈亏 -
交易所止盈止损
止损:加载中… {% if not intraday_discipline %} {% endif %}
止盈:加载中… {% if not intraday_discipline %} {% endif %}
{% else %}
暂无持仓
{% endfor %}

挂止盈止损

将先撤销该合约已有 TP/SL,再按下列价格重挂.

{% elif page in ('strategy', 'strategy_trend', 'strategy_roll') %} {% include 'strategy_trading_page.html' %} {% elif page == 'strategy_records' %} {% include 'strategy_records_page.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 == 'records' %} {% include 'records_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 == 'settings' %} {% include 'settings_panel.html' %} {% endif %} {% if page == 'stats' %}

数据统计

统计分析按北京时间 {{ stats_bundle.stats_reset_hour }}:00切日计入(与顶栏 UTC 列表窗无关).历史总开仓(累计): {{ stats_bundle.total_opens_all }}
{% for seg in stats_bundle.segments %} {% endfor %}
{% endif %}