Thoughts about the stock quote database

Jean-David Beyer jdbeyer@exit109.com
Sun, 17 Dec 2000 20:38:36 -0500


Bill Gribble wrote (in part):
> 
> On Sun, Dec 17, 2000 at 05:09:55PM -0600, Rob Browning wrote:
> > Jean-David Beyer <jdbeyer@exit109.com> writes:
> >
> > > Whether or not you store the price database in a formal dbms or not,
> > > what would you use as the primary key for the entries?
> >
> >   [...]
> >
> > Excellent points.  Thank you.  In addition the stuff we were already
> > worried about, this seems more than enough justification to abandon
> > the idea of putting "split quotes" into the statistics db.
> 
> Wait a minute.  Yes, the problems that Jean-David describes mean it's
> hard to find the quote you want on-line, but I don't think that's
> really relevant to us, at least the way I've been thinking about the
> quote database.
> 
> We store all securities and currencies as gnc_commodity, and it's
> prices for gnc_commodities in terms of other gnc_commodities that the
> price database is storing.  So the primary key of the quote DB is a
> concatenation of the unique identifiers of two gnc_commodities (GUID,
> probably).  All that other stuff just means we need to put more
> information into the gnc_commodity about aliases for the commodity.
> 
I hope I am not just being a dumb newcomer (though I am surely not up to
speed on the internals of GnuCash and double-entry bookkeeping). Yes,
this makes finding on line quotes hard to find, but even assuming you
have found them, how do you store them in a way that you can find out
all the relevant information you already have, if the same companies go
by different names and tickers at different times? I hope the following
question adequately illustrates what I mean.

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} ? And
if they somehow have the same primary keys (so the relevant records can
be found, how did the assignment of the same identifier to the two
different appearing commodities get recognized and assigned?

Because they are the same company, but at different times. 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?

-- 
 .~.  Jean-David Beyer           Registered Linux User 85642.
 /V\                             Registered Machine    73926.
/( )\ Shrewsbury, New Jersey
^^-^^ 8:25pm up 13 days, 5:13, 2 users, load average: 3.45, 3.34, 3.08