I am using a double-entry bookkeeping system.
Currently, only actual journals (purchases, sales, credit notes, cheques, deposits, transfers, etc.) are recorded in the system. Reports like Trial Balance and Balance sheet work out Opening Balances, Retained Earnings, Net income for the year on the fly by summing appropriate journal records.
I now have a new desire to account for shares purchased. Tracking share purchases in a double-entry bookkeeping system goes outside my knowledge, and I would be glad of advice.
I have created an account which corresponds to my account with a share broker. When I pay the broker money, I do a transfer from my bank account to the broker's account, which leaves a cash balance with the broker.
When the broker purchases some shares on my behalf, I create a journal which takes the share cost plus the fees out of the broker account. I'm assuming the other side of this journal would be an expense account for the fee, and a special account for the individual share - is that right? I am also recording (in a linked record) the quantity of shares purchased and purchase price. Should this special account appear on the balance sheet? If so, under what heading?
Likewise when the broker sells shares on my behalf, there will be a journal which puts the sale value back into the broker account, and puts any fees in expenses. It would also presumably deduct the quantity * selling price from the special account. And the quantity sold and selling price would be recorded in the linked record.
However, this is where I get a bit lost. From this information, how do I work out gains/losses, and where do they appear on the balance sheet & trial balance?
Supplementary question: What is the meaning of "Cost Basis" when showing portfolio value, and how is it calculated? Particularly when there are many buy and sell transactions for the share in question.