{% set mf = money_fmt|default(funds_fmt) %} {% macro amt_disp(sym, val) %}{% if amt_fmt is defined %}{{ amt_fmt(sym, val) }}{% else %}{{ val }}{% endif %}{% endmacro %}

趋势回调

生成预览:读取合约 USDT 可用余额快照并计算计划(不下单)。预览有效期 {{ trend_pullback_preview_ttl }} 秒
确认执行:市价首仓 50% + 挂交易所止损;首仓后可手动保本(默认均价+{{ trend_manual_breakeven_offset_pct }}%);剩余 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 | 预览可用快照 {{ mf(trend_preview.snapshot_available_usdt) }} U | 参考价 {{ price_fmt(trend_preview.symbol, trend_preview.live_price_ref) }} | 计划保证金≈{{ mf(trend_preview.plan_margin_capital) }} U | 总张≈{{ amt_disp(trend_preview.symbol, trend_preview.target_order_amount) }}(首仓 {{ amt_disp(trend_preview.symbol, trend_preview.first_order_amount) }} + 补仓 {{ amt_disp(trend_preview.symbol, trend_preview.remainder_total) }})
止损 {{ price_fmt(trend_preview.symbol, trend_preview.stop_loss) }} | {{ trend_add_zone_label(trend_preview.direction) }} {{ 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_disp(trend_preview.symbol, row.contracts) }}
{% elif trend_preview_expired %}
该预览已过期(超过 {{ trend_pullback_preview_ttl }} 秒),请重新点击「生成预览」。
{% endif %}

运行中的计划

{% for t in trend_plans %} {% set sym = t.exchange_symbol or t.symbol %} {% set calc = namespace(rr=None, pnlpct=None) %} {% if t.avg_entry_price is not none and t.stop_loss is not none and t.take_profit is not none %} {% set e = t.avg_entry_price|float %} {% set sl = t.stop_loss|float %} {% set tp = t.take_profit|float %} {% if t.direction == 'long' %} {% set risk = e - sl %} {% set reward = tp - e %} {% else %} {% set risk = sl - e %} {% set reward = e - tp %} {% endif %} {% if risk > 0 %} {% set calc.rr = reward / risk %} {% endif %} {% endif %} {% if t.floating_pnl is not none and t.plan_margin_capital is not none and t.plan_margin_capital|float > 0 %} {% set calc.pnlpct = (t.floating_pnl|float) / (t.plan_margin_capital|float) * 100 %} {% endif %}
#{{ t.id }} {{ sym }} {{ '做多' if t.direction == 'long' else '做空' }}
结束计划
来源: 趋势回调计划 | 风险: {% if t.risk_percent is not none %}{{ t.risk_percent }}%{% else %}—{% endif %} | {{ trend_add_zone_label(t.direction) }} {{ price_fmt(sym, t.add_upper) }} | 已补仓 {{ t.legs_done }}/{{ t.dca_legs }}
均价 {% if t.avg_entry_price is not none %}{{ price_fmt(sym, t.avg_entry_price) }}{% else %}—{% endif %}
止损 {{ price_fmt(sym, t.stop_loss) }}
止盈 {{ price_fmt(sym, t.take_profit) }}
盈亏比 {% if calc.rr is not none %}{{ '%.2f'|format(calc.rr) }}:1{% else %}—{% endif %}
标记价 {% if t.floating_mark is not none %}{{ price_fmt(sym, t.floating_mark) }}{% else %}—{% endif %}
浮盈亏 {% if t.floating_pnl is not none %} {{ mf(t.floating_pnl) }}U{% if calc.pnlpct is not none %} ({{ '%+.2f'|format(calc.pnlpct) }}%){% endif %} {% else %}—{% endif %}
{% if t.breakeven_applied %}已保本 {{ (t.breakeven_applied_at or '')[:16] }}{% endif %}
快照可用: {% if t.snapshot_available_usdt is not none %}{{ mf(t.snapshot_available_usdt) }}U{% else %}—{% endif %} | 计划保证金≈{% if t.plan_margin_capital is not none %}{{ mf(t.plan_margin_capital) }}U{% else %}—{% endif %} | 杠杆: {{ t.leverage }}x
{% else %}
暂无运行中的趋势回调计划
{% endfor %}