Thoughts about the stock quote database

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


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.

> So Dave, and anyone else, it seems to me that we should just go with
> the "split quotes go in the split" approach, and treat the financial
> database as a completely separate issue.  Does anyone have any
> objections to this?  

Yes, I do.  Unless you have some other reason not to want to put
purchase/sell quotes in the database, I think we should stick with the
current plan, which is to have a unified database of "net" quotes and
quotes from buys/sells.  I don't believe sticking quotes in the split
addresses the real problems that the quote database was designed to
address, and it adds more layers of logic to determining the "balance"
of a stock account and to reports that are trying to manipulate stock
prices.

Is it really that painful to put buy/sell prices in the database?  If
it is, then we should consider the approach you're talking about
above, but I don't think it is given our past conversations.

b.g.