A cash account is an account where you trade using only the funds available in your account, without using margin or leverage.
When you open a position, the invested amount is deducted from your available balance. Any unrealized profit or loss on your open positions does not affect your available balance until the position is closed.
Once you close the position, the realized profit or loss is reflected in your account balance.