{# Common HTMX query string for swapping pages/toggle. #} {% set sym_qs %}{{ selected_symbols|join(',') }}{% endset %} {% set qs %}period={{ selected_period }}&account={{ selected_account }}&group_options={{ group_options }}&symbols={{ sym_qs|urlencode }}{% endset %} {% set qs_full %}{{ qs }}&show={{ show }}&page_size={{ page_size }}{% endset %}
Show:
{{ total_rows }} {% if show == 'all' %}total{% else %}open{% endif %} {% if selected_symbols %}· {{ selected_symbols|length }} symbol{% if selected_symbols|length != 1 %}s{% endif %} filtered{% endif %} · account: {% if selected_account %}{{ selected_account }}{% else %}all{% endif %}
{% if total_pages > 1 %} {% set prev_disabled = (page <= 1) %} {% set next_disabled = (page >= total_pages) %}
page {{ page }} / {{ total_pages }}
{% endif %}
{% if extra_columns is defined and extra_columns %} {% endif %} {% if not rows %}
{% if selected_symbols %}No symbols match the selected filter. {% elif show == 'all' %}No positions in scope. {% else %}No open positions. {% endif %}
{% else %}
{% if extra_columns is defined %} {% if 'days_held' in extra_columns %}{% endif %} {% if 'lt_st_split' in extra_columns %}{% endif %} {% if 'premium_received' in extra_columns %}{% endif %} {% if 'origin_event' in extra_columns %}{% endif %} {% if 'days_to_ltcg' in extra_columns %}{% endif %} {% if 'harvestable' in extra_columns %}{% endif %} {% if 'premium_offset' in extra_columns %}{% endif %} {% endif %} {% for r in rows %} {% if extra_columns is defined %} {% if 'days_held' in extra_columns %}{% endif %} {% if 'lt_st_split' in extra_columns %}{% endif %} {% if 'premium_received' in extra_columns %}{% endif %} {% if 'origin_event' in extra_columns %}{% endif %} {% if 'days_to_ltcg' in extra_columns %}{% endif %} {% if 'harvestable' in extra_columns %}{% endif %} {% if 'premium_offset' in extra_columns %}{% endif %} {% endif %} {% endfor %}
Symbol Accounts Qty Mkt $ Open Cost Avg Basis Cash Sunk/sh UnrealizedDays heldLT / STPrem.Origin→LTCGHarv.Prem. off
{{ r.symbol[0] }} {{ r.symbol }} {% if r.open_option_contracts and r.open_option_contracts != 0 %} {{ "%g"|format(r.open_option_contracts|float) }} opt {% elif r.qty == 0 %} closed {% endif %}
{% if r.accounts|length <= 3 %} {{ r.accounts|join(' · ') }} {% else %} {{ r.accounts[0] }} +{{ r.accounts|length - 1 }} more {% endif %} {{ "%.4f"|format(r.qty|float) }} {% if r.market_value is none %} {% else %}${{ "%.2f"|format(r.market_value|float) }}{% endif %} ${{ "%.2f"|format(r.open_cost|float) }} ${{ "%.2f"|format(r.avg_basis|float) }} ${{ "%.2f"|format(r.cash_sunk_per_share|float) }} {% if r.unrealized_pl is none %} {% else %}
{% if r.unrealized_pl < 0 %}-{% else %}+{% endif %}${{ "%.2f"|format(r.unrealized_pl|float|abs) }}
{% if r.open_cost and r.open_cost|float != 0 %} {% set pct = (r.unrealized_pl|float / r.open_cost|float) * 100 %}
{% if pct < 0 %}-{% else %}+{% endif %}{{ "%.1f"|format(pct|abs) }}%
{% else %}
{% endif %} {% endif %}
{{ r.days_held if r.days_held is not none else '—' }}{% if r.days_held is not none %}d{% endif %}{{ "%g"|format(r.lt_qty|float) }}LT / {{ "%g"|format(r.st_qty|float) }}ST${{ "%.0f"|format(r.premium_received|float) }}

Click row to drill down

{% if extra_columns is defined and ('days_to_ltcg' in extra_columns or 'harvestable' in extra_columns or 'premium_offset' in extra_columns or 'origin_event' in extra_columns) %}

→LTCG, Harv., Prem. off, and Origin are tax-view placeholders — not yet wired to live data, so they show for every row. Hover any column header for what it will show.

{% endif %} {% endif %}