Thoughts about the stock quote database

Bill Gribble grib@gnumatic.com
Sun, 17 Dec 2000 19:58:19 -0600


On Sun, Dec 17, 2000 at 08:38:36PM -0500, Jean-David Beyer wrote:
> Do gnc_commodities have unique keys that identify them? E.g., does the
> commodity
> 
> {stock, company_name McAfee Associates, ticker MCAF, other_data} 
> 
> have as one of its keys a unique identifier that is the same as the
> unique identifier of the commodity
> 
> {stock, company_name Network Associates, ticker NETA, other data} ? 

These are two different questions, IMO.  Do gnc_commodities have
unique keys?  Right now, they are required to have a unique key that's
a combination of their exchange and ticker symbol, so yes.  Given your
examples about recycling ticker symbols over time, it seems that this
isn't good enough, but I think that's a somewhat minor problem.
Accounts have pointers to gnc_commodities, not just names.  If the
problem is picking the right stock for the account, there are plenty
of UI ways to make sure you get the right one.

Your second question: what do we do about stocks that change names
and/or ticker symbols?  This is an issue we haven't really addressed.
There are several possible approaches: store "alias" information with
the structure (possibly dated); require a new gnc_commodity to be used
and allow for a transfer of value from one to the other; others.  This
is a significant problem, no doubt.  Right now the user could manually
do the second of these, and we could easily add support for the first
as we redo the quote system this time around.  

> Because they are the same company, but at different times. 

I'm not so sure about that.  It may be the same company, but it's not
the same stock.  I would guess that NETA and MCAF have different CUSIP
ID's; they are fundamentally different securities.

> So if someone who owns 100 shares of NETA wants to know what he paid
> for it, but he bought 50 shares of MCAF at an earlier time, and it
> split 2:1 somewhere in the meantime, would he have an easy way of
> finding it all out?

I would hope so :)

Bill Gribble