Account value is always reflecting the profit/loss. So when you sell, account value will not magically increase because the profit was accounted for in the first place, same as loss, the account value is dynamic always reflecting true value of your stock position + deposit cash…
So nothing happens to account value once you sell, it just removes amount of sold from invested money. However account value has profit/loss already accounted for. In time of sale the profit/loss becomes permanent. Nothing else.
So if you deposit 500$. Your Account value is 500$. Free funds is 500$.
Now you invest 200$ in stock A.
Account value is still 500$. 200 invested + 300$ Free funds.
Now Stock A appreciates 10% in value, giving you
520$ Account Value, 200$ Invested + 20$ Return(220$ Porfolio value) + 300$ free funds.
Now we close position of stock A.
We realise profit of 20$.
Account Value is still 520$, 520$ Free Funds.