{# Inputs: open_options: list[OpenOptionRow] — both long and short, sorted by expiry cash_secured_total: Decimal premium_received_total: Decimal long_cost_total: Decimal today: date #} {% set _expanded = open_options|length > 0 %} {% set _puts = open_options | selectattr('call_put', 'equalto', 'P') | list %} {% set _calls = open_options | selectattr('call_put', 'equalto', 'C') | list %} {% set _longs = open_options | selectattr('side', 'equalto', 'long') | list %} {% set _shorts = open_options | selectattr('side', 'equalto', 'short') | list %}

Open options

{% if _longs %}{{ _longs|length }} long{% endif %} {% if _longs and _shorts %} · {% endif %} {% if _shorts %}{{ _shorts|length }} short{% endif %} {% if cash_secured_total %} · ${{ "{:,.0f}".format(cash_secured_total) }} secured{% endif %} {% if premium_received_total %} · premium +${{ "%.2f"|format(premium_received_total) }}{% endif %} {% if long_cost_total %} · long cost ${{ "%.2f"|format(long_cost_total) }}{% endif %}
{% if not open_options %}
No open option positions.
{% else %} {% if options_summary is defined and options_summary %}
Open contracts
{{ fmt_quantity(options_summary.open_contracts) }}
Net premium
{{ fmt_currency(options_summary.net_premium) }}
Avg DTE
{{ options_summary.avg_dte|round(0)|int }}d
{% endif %}
{% for s in open_options %} {% set dte = (s.expiry - today).days %} {% if dte <= 7 %}{% set dte_class = 'text-warn' %} {% elif dte <= 21 %}{% set dte_class = 'text-label-1' %} {% else %}{% set dte_class = 'text-label-2' %}{% endif %} {% if s.opened_at %} {% set total_days = (s.expiry - s.opened_at).days %} {% set elapsed = (today - s.opened_at).days %} {% if total_days > 0 %}{% set fill_pct = (elapsed / total_days * 100)|round(0, 'common') %}{% else %}{% set fill_pct = 100 %}{% endif %} {% else %} {% set fill_pct = 50 %} {% endif %} {% set is_long = s.side == 'long' %}
{{ 'LONG' if is_long else 'SHORT' }}
{% if s.call_put == 'C' %}CALL{% else %}PUT{% endif %} ${{ "%g"|format(s.strike) }}
{{ s.expiry.strftime('%m/%d/%y') }}
{% if s.opened_at %}opened {{ (today - s.opened_at).days }}d ago{% else %}— {% endif %}
{% if is_long %}-${{ "%.2f"|format(s.cash_basis) }}{% else %}+${{ "%.2f"|format(s.cash_basis) }}{% endif %}
{% if is_long %}cost paid{% elif s.call_put == 'P' %}${{ "{:,.0f}".format(s.cash_secured) }} secured{% else %}premium{% endif %}
{{ dte }}d
{% endfor %}
{% endif %}