Get stock quotes for specified date

John Ralls jralls at ceridwen.us
Fri Dec 9 17:32:31 EST 2016


> On Dec 9, 2016, at 1:30 PM, Stefan Söffing <soeffing at gmx.de> wrote:
> 
> All,
> 
> the price editor currently is able to retrieve today's stock quote for
> the price db. Sometimes it can be useful to retrieve stock quotes for a
> specified historic date, e.g. to update the prices for the last day of
> the financial year as a basis for reporting using the "Nearest in time"
> price source.
> 
> I'd like to suggest to add this feature by introducing a new pop-up
> window with a date selector to the "Get Quotes" button (similar to the
> "remove old" pop-up). I understand that there is an example script
> delivered with GnuCash to serve a similar purpose, i.e. retrieving a
> series of quotes over a given time-period, so obviously the
> Finance::Quote part is able to handle historic data as well.
> 
> If this is considered a worthwhile enhancement I'd be happy to assist in
> implementation. Unfortunately, however, I figured out that the relevant
> part is scripted in Scheme. While I do have some (long-forgotten)
> experience with C, that scm language thing looks quite cryptic to me.
> Nevertheless if someone was willing to adapt the scheme part I'd like to
> try my best in supporting the C development part as much as possible...
> 
> Thanks for listening.

Stefan,

Sorry, you're misinformed. There is no such example script and Finance::Quote [1] is able to retrieve only the latest price. There is in CPAN a package called Finance::QuoteHist [2], but it hasn't been maintained since 2013 and so is unlikely to work as-is. Note as well that it has only two modules, Yahoo and Google, far fewer that Finance::Quote gnc-fq-helper, a perl applet, would need to be modified to optionally call QuoteHist instead of Quote when a date is provided and to format the results for quotes.scm. The latter would need only a change to pass the selected date to gnc-fq-helper. The UI changes would be in C, to src/gnome/dialog-price-edit-db.c, and in XML, to src/gnome/gtkbuilder/dialog-price.glade.

Regards,
John Ralls

[1] http://search.cpan.org/~ecocode/Finance-Quote-1.38/lib/Finance/Quote.pm
[2] http://search.cpan.org/~msisk/Finance-QuoteHist-1.20/lib/Finance/QuoteHist.pm


More information about the gnucash-devel mailing list