{% 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.dca_levels %}
补仓计划明细
| 档位 | 触发价 | 张数 | 状态 |
{% for lv in t.dca_levels %}
| {{ lv.label }} |
{% if lv.price is not none %}{{ price_fmt(sym, lv.price) }}{% else %}—{% endif %} |
{% if lv.contracts is not none %}{{ amt_disp(sym, lv.contracts) }}{% else %}—{% endif %} |
{{ lv.status_label }} |
{% endfor %}
{% 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