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

Jean-David Beyer jdbeyer@exit109.com
Fri, 05 Jan 2001 17:56:46 -0500


Douglas Moyes wrote:
> 
> 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

There is also the Identified Lots Method, where you specify which actual
shares are to be sold. (Sometimes you may want to sell the ones you paid
most for, sometimes those you paid least for, depending on the tax
situation.)

Furthermore, there are programming opportunities when stock splits
occur. You must be able to figure out the cost basis.

If you buy 100 shares of STCK @$50 and later STCK does a 2:1 split and
then sell 100 shares of STCK, the cost basis is $25, not $50 (assuming
commission free trading; otherwise the commissions add to the cost basis
and subtract from the sale price per share). I have seen a 13:12 split
or some screwball thing like that happen, too.
> 
> 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.

Interesting idea. But if the DBMS approach to data storage works out
well, the data interface is sort-of done. You just activate the helper
program and it does what is needed in the database. In fact, the
application might just be a trigger handler in the database if you are
lucky.

-- 
 .~.  Jean-David Beyer           Registered Linux User 85642.
 /V\                             Registered Machine    73926.
/( )\ Shrewsbury, New Jersey
^^-^^ 5:45pm up 2 days, 24 min, 4 users, load average: 3.80, 3.74, 3.74