{% macro period_stats(title, s) %}

{{ title }}

{{ s.range_label }}
开单次数
{{ s.opens_count }}
平仓笔数
{{ s.closed_count }}
胜率
{% if s.win_rate_pct is not none %}{{ s.win_rate_pct }}%{% else %}-{% endif %}
净盈亏(U)
{{ money_fmt(s.net_pnl_u) }}
亏损额合计(U)
{{ money_fmt(s.loss_sum_u) }}
单笔最大亏损(U)
{% if s.max_single_loss is not none %}{{ money_fmt(s.max_single_loss) }}{% else %}-{% endif %}
单笔最大盈利(U)
{% if s.max_single_profit is not none %}{{ money_fmt(s.max_single_profit) }}{% else %}-{% endif %}
最大回撤(U)
{{ money_fmt(s.max_drawdown_u) }}
当前连续亏损笔数
{{ s.consecutive_losses }}
最长连续亏损(交易日)
{{ s.max_loss_streak_days }} 天
期内最大亏损日
{% if s.worst_day %}{{ s.worst_day }}({{ money_fmt(s.worst_day_pnl) }}U){% else %}-{% endif %}
{% endmacro %}

加密货币|Gate 机器人交易监控

{{ exchange_display }}
交易执行 交易记录 计划历史 统计分析
{% with msg=get_flashed_messages() %}{% if msg %}
{{ msg[0] }}
{% endif %}{% endwith %}
数据导出(v{{ data_export_version }} CSV,UTF-8;交易记录含开仓类型列及交易所对齐字段): 交易记录
交易所
{{ exchange_display }}
总交易
{{ total }}
错过次数
{{ miss_count }}
胜率
{{ rate }}%
资金账户(USDT)
{% if funding_usdt is not none %}{{ money_fmt(funding_usdt) }}U{% else %}—{% endif %}
交易日
{{ trading_day }}
当日资金(交易账户)
{{ money_fmt(current_capital) }}U
实时价格更新时间:--(北京时间 UTC+8)
{% if page == 'trade' %}

机器人下单监控(单仓)

{% if focus_order_id %} 放大查看K线(100根) {% else %} 暂无持仓可放大 {% endif %}
规则:单仓;与「趋势回调」计划互斥;BTC {{ btc_leverage }}x / 山寨 {{ alt_leverage }}x; {% if can_trade %}可开仓{% else %}不可开仓(有持仓、有趋势回调计划,或未到北京时间 {{ reset_hour }}:00){% endif %}; 按风险比例自动计算仓位
以损定仓:风险 {{ risk_percent }}% |移动保本:下单可勾选关闭;开启时 {{ breakeven_rr_trigger }}R 触发(每 1R 阶梯上移),偏移 {{ breakeven_offset_pct }}%
划转:自动划转 {{ '开启' if auto_transfer_enabled else '关闭' }}(每天北京时间 {{ auto_transfer_bj_hour }}:00起该整点小时内尝试;账簿按 UTC 自然日去重;界面时间为北京;将 {{ auto_transfer_to }} 补足到 {{ money_fmt(auto_transfer_amount) }}U,来自 {{ auto_transfer_from }})
成交价自动取交易所实时+成交回报
{% for o in order %}
{{ o.symbol }} | {{ '做多' if o.direction == 'long' else '做空' }}
风格:{{ o.trade_style or 'trend' }} | 风险:{{ o.risk_percent or '-' }}%≈{{ money_fmt(o.risk_amount) }}U | {% if 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) }} 止盈:{{ price_fmt(o.symbol, o.take_profit) }} | 盈亏比:{% if o.rr_ratio is not none %}1:{{ '%.2f'|format(o.rr_ratio) }}{% else %}-{% endif %} | 现价:- | 浮盈亏:- | 计划基数:{{ money_fmt(o.margin_capital) }}U | 所保证金:- | 杠杆:{{ o.leverage }}x | 仓位占比:{{ o.position_ratio }}%
平仓
{% endfor %}

趋势回调策略

生成预览:读取合约 USDT 可用余额快照并计算计划(不下单)。预览有效期 {{ trend_pullback_preview_ttl }} 秒
确认执行:市价首仓 50% + 挂交易所止损;剩余 50% 在止损与补仓上沿之间共 {{ trend_pullback_dca_legs }} 档(程序可能因最小张数自动减档)市价补仓;止盈由程序监控
确认执行时若当前可用余额与预览快照相对偏差 > {{ trend_preview_max_drift_pct }}% 会拒绝并要求重新预览。
{% if trend_preview %}
当前预览(剩余 {{ trend_pullback_preview_ttl }}s) 倒计时加载中…
{{ trend_preview.symbol }} {{ '做多' if trend_preview.direction == 'long' else '做空' }} {{ trend_preview.leverage }}x | 预览可用快照 {{ money_fmt(trend_preview.snapshot_available_usdt) }} U | 参考价 {{ price_fmt(trend_preview.symbol, trend_preview.live_price_ref) }} | 计划保证金≈{{ money_fmt(trend_preview.plan_margin_capital) }} U | 总张≈{{ amt_fmt(trend_preview.symbol, trend_preview.target_order_amount) }}(首仓 {{ amt_fmt(trend_preview.symbol, trend_preview.first_order_amount) }} + 补仓 {{ amt_fmt(trend_preview.symbol, trend_preview.remainder_total) }})
止损 {{ price_fmt(trend_preview.symbol, trend_preview.stop_loss) }} | 补仓上沿 {{ price_fmt(trend_preview.symbol, trend_preview.add_upper) }} | 止盈 {{ price_fmt(trend_preview.symbol, trend_preview.take_profit) }} | 风险比例 {{ trend_preview.risk_percent }}%
{% for row in trend_preview_levels %} {% endfor %}
#补仓触发价该档张数
{{ row.i }}{{ price_fmt(trend_preview.symbol, row.price) }}{{ amt_fmt(trend_preview.symbol, row.contracts) }}
{% elif trend_preview_expired %}
该预览已过期(超过 {{ trend_pullback_preview_ttl }} 秒),请重新点击「生成预览」。
{% endif %}

运行中的计划

{% for t in trend_plans %}
#{{ t.id }} {{ t.symbol }} | {{ '做多' if t.direction == 'long' else '做空' }} | {{ t.leverage }}x
可用快照:{{ money_fmt(t.snapshot_available_usdt) }}U | 计划保证金≈{{ money_fmt(t.plan_margin_capital) }}U | 总张≈{{ amt_fmt(t.symbol, t.target_order_amount) }} 首仓{{ amt_fmt(t.symbol, t.first_order_amount) }} 补仓档{{ t.dca_legs }}
止损:{{ price_fmt(t.symbol, t.stop_loss) }} 补仓上沿:{{ price_fmt(t.symbol, t.add_upper) }} 止盈:{{ price_fmt(t.symbol, t.take_profit) }}
均价:{{ price_fmt(t.symbol, t.avg_entry_price) }} 已补仓:{{ t.legs_done }}/{{ t.dca_legs }}
浮盈亏(交易所): {% if t.floating_pnl is not none %}{{ money_fmt(t.floating_pnl) }} U{% else %}—{% endif %}{% if t.floating_mark is not none %} | 标记价: {{ price_fmt(t.symbol, t.floating_mark) }}{% endif %}
结束计划
{% else %}
暂无运行中的趋势回调计划
{% endfor %}
{% endif %} {% if page == 'records' %}

交易记录

{% for r in record %} {% set stop_show = r.effective_stop_loss or r.initial_stop_loss or r.stop_loss %} {% set tp_show = r.effective_take_profit or r.take_profit %} {% set pnl_val = (r.display_pnl_amount or 0)|float %} {% endfor %}
品种类型方向成交止损止盈基数杠杆持仓分钟开仓(展示)平仓(展示)盈亏U(展示)结果操作
{{ r.symbol }} {{ r.monitor_type }} {{ '做多' if r.direction == 'long' else '做空' }} {{ price_fmt(r.symbol, r.trigger_price) }}{{ price_fmt(r.symbol, stop_show) }} {{ price_fmt(r.symbol, tp_show) }} {% if r.margin_capital is not none and r.margin_capital != '' %}{{ money_fmt(r.margin_capital) }}{% else %}-{% endif %} {{ r.leverage or '-' }} {{ r.effective_hold_minutes or 0 }} {{ r.display_opened_at }} {{ r.display_closed_at }}{{ money_fmt(r.display_pnl_amount) }}{% if r.monitor_type == '趋势回调' and r.display_pnl_source == 'local' %}{% elif r.monitor_type == '趋势回调' and r.display_pnl_source == 'exchange' %}{% endif %} {% set effective_result = r.effective_result %} {% if effective_result in ["止盈","保本止盈","移动止盈"] %}{{ effective_result }} {% elif effective_result in ["止损","强制清仓","手动平仓"] %}{{ effective_result }} {% else %}{{ effective_result }}{% endif %}

记录错过机会

{% endif %}
{% if page == 'plan_history' %}

已结束的趋势回调计划

删除将同时移除 trend_plan_id 关联的「趋势回调」交易记录及该计划对应的预览快照归档。交易所平仓同步起点(北京日期):{{ exchange_sync_from_label }}EXCHANGE_POSITION_SYNC_FROM_BJ)。
{% if plan_history and plan_history|length > 0 %}
{% for p in plan_history %} {% endfor %}
ID品种方向杠杆状态结束开仓时间计划保证金≈操作
{{ p.id }} {{ p.symbol }} {{ '做多' if p.direction == 'long' else '做空' }} {{ p.leverage }}x {{ p.status_label }} {{ p.message or '-' }} {{ (p.opened_at or '-')[:16] }} {% if p.plan_margin_capital is not none %}{{ money_fmt(p.plan_margin_capital) }}{% else %}-{% endif %}
{% else %}
暂无已结束的计划
{% endif %}

预览快照(自本版本起留存)

每次「生成预览」自动归档;取消、过期或执行后仍可点开查看当时参数。执行后状态为「已执行」并带关联计划 ID。
{% if preview_snapshots and preview_snapshots|length > 0 %}
{% for s in preview_snapshots %} {% endfor %}
ID时间品种方向杠杆状态快照余额U操作
{{ s.id }} {{ (s.preview_created_at or '-')[:16] }} {{ s.symbol }} {{ '多' if s.direction == 'long' else '空' }} {{ s.leverage }}x {{ s.outcome_label }}{% if s.executed_plan_id %} #{{ s.executed_plan_id }}{% endif %} {{ money_fmt(s.snapshot_available_usdt) }}
{% else %}
暂无预览快照(新版本生成预览后将出现在此)
{% endif %}
{% endif %} {% if page == 'stats' %}

数据统计

持仓占用导致错过(累计)
{{ occupied_miss_total }}
已平仓「机器人下单 / 趋势回调」按平仓时间归入北京时间下的交易日;胜率按盈笔数/(盈+亏)。历史总开仓(累计): {{ stats_bundle.total_opens_all }}
{{ period_stats("日统计", stats_bundle.day) }} {{ period_stats("周统计", stats_bundle.week) }} {{ period_stats("月统计", stats_bundle.month) }}
{% endif %}
详情