I have a spreadsheet where I pretend that unrealized gains are in fact realized, but I don’t know what to do with the change in ‘margin used’. Let’s say I transfer $50 to my brokerage, get $100 of buying power and use it all for a share of stock. So I reduce cash 50, increase liability 50, and increase assets 100. My equity is unchanged. Now the stock appreciates to $105 - that’s 5 to income (less some tax liability) and an increase of assets by 5. Equity still unchanged. But now the margin used drops to say 49.. Ignoring tax, if you subtract the income and liability from assets you have 51 of equity leftover. How does that increase from your initial investment of 50 without corresponding income? And when I sell the stock, do I really get 56 in cash??