Getting stock quotes for a specific date

Edward Doolittle edward.doolittle at gmail.com
Thu Apr 2 00:46:30 EDT 2015


Brendan, the feature you requested is already available ... for quotes in
the future. See
http://www.gnucash.org/docs/v2.6/C/gnucash-guide/invest-stockprice1.html#invest-stockprice-auto2
and scroll down to 8.6.3.2 . You run gnucash --add-price-quotes etc. from a
cron job scheduled for the times when you know you're going to want or need
quotes, like Fridays after market close or end of day at year end.

(I actually use cron and anacron on my Mac laptop, but installing them and
setting them up required some time investment. Macs have a different
default scheduler now, about which I know little. Someone else on this list
may be able to help, otherwise you should ask somewhere that specializes in
Mac help.)

For quotes in the past, I think it is wise to do them by hand. Since you're
on a Mac, and I assume you downloaded an executable, you likely don't have
pycash available without recompiling. I didn't know about the modifications
to gnc-fq-helper, so thanks Mike for pointing that out.  It might be
worthwhile to drop in a modified version of gnc-fq-helper, grab the quotes,
then put back the unmodified version. But I still think it would be wise to
do them by hand.

On 1 April 2015 at 16:40, Brendan Simon <Brendan at brendansimon.com> wrote:

> On 1/04/2015 5:59 pm, Mike Alexander wrote:
> > --On April 1, 2015 at 3:50:14 PM +1100 Brendan Simon
> > <Brendan at BrendanSimon.com> wrote:
> >
> >> 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.
>
> For my specific needs it's probably simpler to do it by hand (since the
> capability is not available in GnuCash, and the number of stocks
> involved is manageable).  It might be a good addition to add to GnuCash
> though -- to be able to specify a particular date, or end of accounting
> period.  I know I wouldn't always to remember to update quote info on
> the last day of the financial year.  Might be even nicer to be able to
> configure GnuCash to get history in some configurable period (e.g.
> daily, or Fridays, and/or end of each month, etc).
>
> Cheers :)
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.
>



-- 
Edward Doolittle
Associate Professor of Mathematics
First Nations University of Canada
1 First Nations Way, Regina SK S4S 7K2

« Toutes les fois que je donne une place vacante, je fais cent mécontents
et un ingrat. »
-- Louis XIV, dans Voltaire, Le Siècle de Louis XIV, Chap. XXVI


More information about the gnucash-user mailing list