Getting stock quotes for a specific date

Mike Alexander mta at umich.edu
Wed Apr 1 02:59:42 EDT 2015


--On April 1, 2015 at 3:50:14 PM +1100 Brendan Simon 
<Brendan at BrendanSimon.com> wrote:

> I've *finally* got FinanceQuote working on my Mac (yay me).
>
> My account period is set to end on Jun-2014 (end of last financial
> year for Australia).  After getting quotes, the advanced portfolio
> report has the very latest values of the securities (i.e.
> 31-Mar-2015) which is not what I need.  I want the report to show the
> values as of 30-Jun-2014.  Can GnuCash get quotes from a specific
> date?

It's possible, although not particularly easy.  Take a look at 
<http://wiki.gnucash.org/wiki/FAQ#Q:_Can_I_import_historical_prices_or_quotes.3F>. 
This links to two pages that contain Python scripts to import prices. 
These both require a copy of GnuCash which is built with the Python 
bindings, which might be a problem.

You could also hack a copy of gnc-fq-helper, the Perl script that 
actually fetches the prices, to fetch prices for a date in the past 
instead of the current date.  This would require using the 
Finance::QuoteHist Perl module as described in 
<http://wiki.gnucash.org/wiki/Stocks/get_prices>.

There is a Perl script attached to 
<http://gnucash.1415818.n4.nabble.com/SPAM-5-Fwd-Re-Historical-price-quotes-td1417716.html> 
which might be a suitable replacement for gnc-fq-helper.  I haven't 
tried using it in GnuCash, but I just tested it and it seems to still 
work and produce plausible output.

         Mike
 


More information about the gnucash-user mailing list