{# Inputs: allocation: AllocationView from portfolio.allocation.build_allocation() Companion to _portfolio_allocation.html that focuses purely on the cash-vs-positions split: how much of the account is deployed in equities vs sitting in cash (and within cash, how much is pledged as CSP collateral and therefore not freely deployable). #} {% set positions_color = 'var(--color-rank-1)' %} {% set cash_color = 'rgba(142,142,147,0.6)' %} {% set cash_pledged_color = 'rgba(255,159,10,0.65)' %} {% set ns = namespace(free_cash=0.0, pledged_cash=0.0) %} {% for s in allocation.slices %} {% if s.is_pledged_cash %} {% set ns.pledged_cash = s.market_value|float %} {% elif s.is_cash %} {% set ns.free_cash = s.market_value|float %} {% endif %} {% endfor %} {% set total_val = allocation.total_market_value|float %} {% set positions_val = total_val - ns.free_cash - ns.pledged_cash %} {% if total_val <= 0 %}