Historical price quotes

David Hampton hampton-gnucash at rainbolthampton.net
Sat Jul 2 20:44:07 EDT 2005


On Sat, 2005-07-02 at 17:10 -0700, Jon Hamkins wrote:
> I am interested in getting historical quotes.  I am getting current
> quotes within gnucash using the Finance::Quote module, but it doesn't do
> historical quotes.  I'm really hoping to avoid hand entry.
> 
> In 2002, David Hampton wrote on this list that Finance::QuoteHist was

Ooo, I'm being quoted. :-)  From the first year I used Gnucash, even.  I
suppose that means I have to respond.

> being worked on by perl developers.  I see now that in the last couple
> of weeks, v. 1.00 of Finance::QuoteHist has been released:
> 
> http://search.cpan.org/dist/Finance-QuoteHist/
> 
> Looks promising!  Has anyone tried using Finance::QuoteHist within
> gnucash?

There is a function in gnucash called yahoo-get-historical-quotes, but
its never called.  I have no idea if it works, there's currently no way
to test it, and even if it does work it will need to have a user
interface written for it.  Looks like somewhere along the line a
developer started work on historical quotes but never finished it.

I haven't paid any attention to the development of F::QH.  Unless it
mimics the F::Q interface (which it can't because you have to supply
date ranges) it can't be used with Gnucash.  Gnucash would have to be
modified to interface the two programs.  Not that that's a bad idea.
Please file an enhancement request in bugzilla if one doesn't already
exist.

> Or from outside it?  I'm sure I could get the historical data
> using a perl script that uses the Finance::QuoteHist module, but I don't
> know enough about gnucash to know how to incorporate the data.  (A grep
> of my gnucash data file doesn't seem to yield the prices I already have
> entered.)

They're stored between <price> and </price> markers.  The problem would
be generating unique ID numbers for each price.  You could do it, but of
course I don't recommend hand editing the data file.

If you want to pull a lot of quotes for the same time range, you might
try rewriting the perl finance-quote-helper script to pull from F::QH
instead of F::Q. 

David




More information about the gnucash-user mailing list