{# Sim result partial: the honest real-cost equity curve + metrics + timeline slider + state panel. The slider scrubs the per-day arrays embedded in #sim-data ENTIRELY client-side (no per-tick refetch); only a capital/period change re-fetches /paper/sim/run. There is NO cost/flat toggle — the cost is the MEASURED real per-coin spread (a fact, not a knob). When the measured artifact has not been precomputed yet we show a short 'precomputing' note (never a flat slider, never a 500). Bybit is the cockpit's only venue since Task 7a removed the legacy venue toggle. #}
{% if measured_pending %} {% if is_ibkr %}

honest backtest curve precomputing — check back after the nightly job (the precomputed replay is built out-of-band by the fxhnt-backtest-refs Job).

{% else %}

measured real-cost curve precomputing — check back after the nightly job (the per-coin measured-cost artifact is built out-of-band by fxhnt compare-measured-precompute).

{% endif %} {% else %} {% if is_bybit %} {# Measured cost caption. Each coin pays its real per-COIN cost (published taker fee + half its real measured spread) so the curve is the honest de-inflated number. The Bybit liquid book uses the REAL L1 quoted spread (forward-realistic) once a refresh has run; absent that it falls back to the Corwin–Schultz daily-high/low proxy. #} {% if used_real_spread %}

real trading cost, per coin — fee + spread · avg drag {{ '%.2f'|format(cost_drag_bps / 100.0) }}%

{% else %}

real trading cost, per coin — fee + spread · avg drag {{ '%.2f'|format(cost_drag_bps / 100.0) }}%

{% endif %} {% elif is_ibkr %}

real trading cost — modeled nightly, not adjustable

{% endif %} {% endif %} {% if not measured_pending %} {% if n_points == 0 %}

no simulated days for this period — pick a date range that overlaps the curve's history.

{% else %}
CAGR
{{ '%.1f'|format(100*metrics.cagr) }}%
Sharpe
{{ '%.2f'|format(metrics.sharpe) }}
max DD
{{ '%.1f'|format(100*metrics.max_dd) }}%
worst year
{{ '%.1f'|format(100*metrics.worst_year) }}%
best year
{{ '%.1f'|format(100*metrics.best_year) }}%
final $
${{ metrics.end_value|money }}
{% if is_bybit %}
Backtest (real measured cost) — naive equal-weight 4-edge Bybit book over the precomputed measured-cost history; scale by capital / window by period
{% elif is_ibkr %}
Backtest (honest replay cost) — precomputed nightly replay of this strategy over its own history; scale by capital / window by period
{% endif %}
{{ curve|safe }}
scrub timeline →
date
equity
drawdown
leverage
killed
{# n_active counts the instruments/coins HELD that day (bybit: the ~64-coin liquid universe; ETF book: the ~5 ETFs) — NOT the book's sleeves (the 4 edges). Label it "positions" so a 4-edge book doesn't read as having 64 "sleeves". #}
active positions
{% if sensitivity and sensitivity.rows %} {# LEVERED shadow: the honest financing SENSITIVITY BAND — the verdict hinges on the IBKR margin rate, so show it across a range + the break-even, not one assumed number. #}
Financing sensitivity — the levered verdict hinges on the borrow rate, shown across a range (leverage {{ '%.2f'|format(sensitivity.leverage) }}×)
Break-even ≈ {{ '%.1f'|format(sensitivity.break_even_pct) }}%/yr (the book's own return) — above that, leverage subtracts return. Unlevered 1×: {{ '%.1f'|format(sensitivity.base_ann_return_pct) }}%/yr at {{ '%.1f'|format(sensitivity.base_ann_vol_pct) }}% vol, Sharpe {{ '%.2f'|format(sensitivity.base_sharpe) }}.
{% for r in sensitivity.rows %}{% endfor %}
borrow ratelevered returnlevered volSharpe
{{ '%.2f'|format(r.rate_pct) }}%{% if r.is_current %} · current{% endif %}{{ '%.1f'|format(r.ann_return_pct) }}%/yr{{ '%.1f'|format(r.ann_vol_pct) }}%{{ '%.2f'|format(r.sharpe) }}

IBKR Pro USD ≈ 5.8% (<$100k) to ~5.3% ($100k–1M); Lite +1%; ~1–3% = institutional/portfolio margin. Charged on the borrowed (L−1) leg only. Same Sharpe as the base before financing — leverage adds return only below the break-even, and lowers Sharpe at any positive rate.

{% endif %} {% endif %} {% endif %} {% if (is_bybit or is_ibkr) and forward %}
Live forward — {{ forward.display_name }} ({{ forward.venue }})
{% if forward.t0 %}T0 {{ forward.t0 }} — {% endif %} gate {{ forward.gate_status }} {% if forward.gate_reason %}({{ forward.gate_reason }}){% endif %} {% if forward.as_of %} · as of {{ forward.as_of }}{% endif %}
{% if forward.n_points %}
forward days
{{ forward.days }}
forward return
{{ '%.2f'|format(forward.total_return_pct) }}%
forward Sharpe
{{ '%.2f'|format(forward.sharpe) }}
{{ forward.curve|safe }}
{% else %}

no live forward NAV recorded yet — the nightly track starts booking from T0 once the Bybit warehouse has data.

{% endif %}
{% endif %}