Implementing proper cost basis tracking for shares

Dave Peticolas dave@krondo.com
Wed, 18 Oct 2000 19:01:33 -0700


Robert Graham Merkel writes:
> A while ago (check the mail archives), we had a discussion on 
> share reporting, and specifically, calculating share cost basis.
> The upshot was that we need to track which parcel of shares a share
> sale comes from.  With the new file format and hash store now
> available, it's time to think about doing it.
> 
> As far as I can see, all we need is for each share account to
> store a table with the details of the currently owned parcels,
> and each "sell" transaction to contain the details of which parcels
> have been sold.

Isn't that a reporting issue? I believe you can decide after the fact
whether you are going to do LIFO or FIFO or some other form of
tracking, so keeping that information in a permanent table seems like
too much overhead. Can't we always compute the table from the list of
splits in the stock account?


> The next question is "how do we track income and expenses related to
> a particular share account?", such as dividend payments, brokerage
> fees and the like.  My initial suggestion is for each share account
> to contain a "accounts containing income/expense transactions
> related to this account" list, and each transaction related to
> a share account should have a "Hi, I'm a <share account foo>
> transaction".  The other alternative is to insist that dedicated
> account(s) be set up so that every expense and all income related
> to trading a particular stock should be placed in those accounts.

It starts to get complicated, but maybe there's no other way around
it. Should the "Hi, I'm a ..." tag be for transactions or splits?
Example: you buy x shares of A and y shares of B with one check,
with two brokerage fees, one for A and one for B.

dave