accounting for stock trades

Ed Warnicke hagbard@physics.rutgers.edu
Wed, 01 Jan 2003 21:09:46 -0500


I think there is a bit of a problem in how gnucash accounts for
stock trades ( and by extention all commodity/currency trades ).

If I have a Cash Asset Account "CashAccount" and a Stock
Account for a particular stock "StockAccount", I account for
a purchase by building a transaction which debits CashAccount
by x USD and credits StockAccount by y Shares, where
x/y = Price1.  As long as I hold these shares the Balance Sheet
report shows any gain or loss as new prices for the shares
are reported as an "Unrealized Gain(Loss)" which is added to
my Liabilities and preserves the "Assets = Liabilities + Equity"
equation.  

When I subsequently liquidate all of these shares with a
transaction which debits y Shares from StockAccount and
credits z dollars to CashAccount, where z/y = Price2.

I can see no way in this senario to account for the realized
gain/loss inherent in these transactions.  Neither could anyone
on the #gnucash channel last night ( at least not with gnucashes
current capabilities).  My questions are this:

Am I the only one who thinks this is an important problem?

What would be the right way to account for this?

Ed