{% extends "base.html" %} {% block title %}Investments{% endblock %} {% block page_title %}Investment Portfolio{% endblock %} {% block topbar_actions %}
Add Holding {% endblock %} {% block extra_css %} {% endblock %} {% block content %} {% if portfolio.count == 0 %}
No investments yet

Track stocks, ETFs, crypto, real estate, and more.

Add Holding
{% else %}
Total Value
{{ portfolio.total_value | currency }}
Total Cost
{{ portfolio.total_cost | currency }}
Unrealized P&L
{{ portfolio.total_gain | currency }}
Return
{% if portfolio.total_gain_pct >= 0 %}+{% endif %}{{ portfolio.total_gain_pct }}%
{# ── Reusable holdings table macro ──────────────────────────────────────── #} {% macro holdings_table(inv_list) %} {% for inv in inv_list %} {% if inv.ticker %} {% endif %} {% endfor %}
Asset Price 1D Chg Value P&L
{{ (inv.ticker or inv.asset_name[:2]).upper()[:2] }}
{{ inv.asset_name }}
{% if inv.ticker %}{{ inv.ticker }} · {% endif %} {{ asset_labels.get(inv.asset_type, inv.asset_type) }}
{% if inv.current_price %} {{ inv.current_price | currency }} {% else %} {% endif %} {% if inv.ticker %} {% else %}{% endif %} {{ inv.current_value | currency }}
{% if inv.unrealized_gain >= 0 %}+{% endif %}{{ inv.unrealized_gain | currency }}
{% if inv.unrealized_gain_pct >= 0 %}+{% endif %}{{ inv.unrealized_gain_pct }}%
{% if inv.ticker %} {% endif %}
{% endmacro %}
Allocation
{% for item in portfolio.allocation %}
{{ item.type | replace('_',' ') | title }}
{{ item.value | currency }} {{ item.pct }}%
{% endfor %}
{# Per-account balance breakdown #} {% if portfolio.account_groups %}
By Account
{% for grp in portfolio.account_groups %}
{{ grp.account.name if grp.account else 'Unlinked' }} {{ grp.total_value | currency }}
{% endfor %}
{% endif %}
{% if portfolio.account_groups %} {% for grp in portfolio.account_groups %}
{{ grp.account.name if grp.account else 'Unlinked Holdings' }} {{ grp.total_value | currency }}
{{ grp.investments | length }} holding(s)
{{ holdings_table(grp.investments) }}
{% endfor %} {% else %}
Holdings Click to expand price chart
{{ holdings_table(portfolio.investments) }}
{% endif %}
{% endif %} {% endblock %} {% block extra_js %} {% if portfolio.count > 0 %} {% endif %} {% endblock %}