Features, features, features, why not add one more?

Douglas Moyes silence@inorbit.com
Fri, 5 Jan 2001 14:30:42 -0800 (PST)


I haven't read anything about changes to the stock account handling in GNUcash
as of yet, and so I have a few recommendations for changes:

In trading stocks, it is not enough simply to keep track of the number of
stocks held and its current price, you also need to keep track of how many
of each share was purchased at a certain price and how many of which are
still held. Essentially, the stock system needs to be changed into a 
specialized inventory program specifically for handling a stock.

I'll explain:

The following purchases are made (hypothetically):
date	stock	price	shares	value
5/19/00	PALM	26 1/4	100	2625.00	
6/20/00	PALM	40 3/16	50	2009.38
1/04/01	PALM	24 5/16	200	4862.50
And the flowing stocks are sold:
7/25/00 PALM	30 1/4	50	1512.50
1/08/01 PALM	26 1/16	200	5212.50

After all these executions have been made, you have a total of 100 shares
of PALM. But what are the capital gains? It all depends on how the shares
are cleared. Two methods are generally used LIFO and FIFO. The advantage of
LIFO is that it gives a better indication of of how the markets are today
rather than that of the past. FIFO requires less paperwork if done in
a manual system, and generally keeps less data due to old entries being cleared
first. Of course, one may choose any clearing option, but if one is not
consistent, the data gained is pretty much worthless unless you're trying to
pay less taxes for one year.

If the LIFO system is used: 100 shares of PALM at 26 1/4 will be remaining, 
with total capital gains of $-146.88

If FIFO was used: 100 shares of PALM at 24 5/16 will be remaining, with total
capital gains of $-340.53

Many financial programs, such as MS Money keep track of this and automatically
update these accounts accordingly. A simple solution to this, and what I had
planned for the accounting system I was designing way back, was to  tie in
a program to an account. Each time a transaction occurred, that information
was dumped to another program, which then fed information back to the main
accounting program which could also be another transaction. This program
could be used to keep track of stocks in a separate database from GNUcash, and
update a "Capital Gains" account accordingly. Also, it could be used to compute
other values, like: say, your supposed to put 10% of your pay check into
your investment account, you could create a simple script (even a shell script)
which would compute 10%, print out a check, and output data via stdout for a 
transfer from your checking account to your investment account. 

Also, with external program support in this fashion, one could create a program
that would automatically interface with GNUcash non-interactively to record
retail sales transactions. This is one of the major differences between a
simple personal financial program, to one that is used by large businesses:
external extendibility.