{# 5-strategy lot-picker comparison rendered under the per-account sim cards. `lot_comparison` is None on insufficient lots; `lot_comparison_insufficient` carries the engine error message so we can show a graceful fallback. #} {% if lot_comparison_insufficient %}
Lot strategy comparison
Comparison unavailable: {{ lot_comparison_insufficient }}.
{% elif lot_comparison %}

Lot strategy comparison

Recommended: {{ lot_comparison.results[lot_comparison.recommended_idx].strategy.replace('_', ' ').title() }}
{% for r in lot_comparison.results %} {% set is_rec = loop.index0 == lot_comparison.recommended_idx %} {% if r.notes %} {% endif %} {% endfor %}
Strategy Pre-tax P&L After-tax P&L Wash sale Lots
{{ r.strategy.replace('_', ' ').title() }} {% if is_rec %} Recommended {% endif %} ${{ "%.2f"|format(r.pre_tax_pnl|float) }} ${{ "%.2f"|format(r.after_tax_pnl|float) }} {% if r.has_wash_sale_risk %} ${{ "%.2f"|format(r.wash_sale_disallowed|float) }} disallowed {% else %} {% endif %}
{{ r.picks|length }} lot{% if r.picks|length != 1 %}s{% endif %} {% for p in r.picks %} {% endfor %}
Acquired Qty Basis LT/ST
{{ p.acquired_date }} {{ p.qty_consumed }} ${{ "%.2f"|format(p.adjusted_basis|float) }}/sh {{ 'LT' if p.is_long_term else 'ST' }}
{% for n in r.notes %}{{ n }}{% if not loop.last %}; {% endif %}{% endfor %}
{% endif %}