First, the balance sheet is where assets, liabilities, & equity live.
Balance Sheet Identity: Assets = Liabilities (+ Equity)
The income statement is where income and expenses live.
General Income Statement Identity: Income = Revenue - Expenses
If you want to model yourself correctly (like a business), change your "income" account to "revenue".
Recognized & Realized
If you haven't yet closed the position, your gain/loss is "recognized". If you have closed the position, it's "realized".
Recognized Capital Gains(Losses)
Assuming no change in margin requirements:
- Increase/decrease the "recognized capital gains" account under assets by the increase/decrease in the value of the position
- Increase/decrease equity by the increase/decrease in the value of the position
Margin interest should increase margin liabilities thus decrease equity and can be booked as an expense on the income statement.
Margin requirements for shorts should not be booked under liabilities unless if you also book a contra-asset balancing out the equity. Ask a new question for details on this.
Realized Capital Gains(Losses)
- Credit off the position (the initial cost & any accumulated recognized capital gains/losses) under assets
- Debit off any liabilities (margin) due the position
- Debit cash in the amount of the liquidated position
- Increase/decrease equity by the gain/loss due to the position if they haven't been marked under "recognized capital gains/losses"
- Mark the sale of the position as "Revenue"
- Mark the buy of the position as "Expenses"
Balance Sheet Identity Concepts
One of the most fundamental things to remember when it comes to the balance sheet identity is that "equity" is derived.
If your assets increase/decrease while liabilities remain constant, your equity increases/decreases.
Double Entry Accounting
The most fundamental concept of double entry accounting is that debits always equal credits.
Here's the beauty: if things don't add up, make a new debit/credit account to account for the imbalance. This way, the imbalance is always accounted for and can help you chase it down later, the more specific the account label the better.