Finance::Quote Yahoo_JSON Alpha Vantage
Chris Good
goodchris96 at gmail.com
Mon Apr 2 20:00:30 EDT 2018
> Message: 5
> Date: Mon, 2 Apr 2018 17:59:28 -0500
> From: Les <lelliott5 at gmail.com>
> To: gnucash-user at gnucash.org
> Subject: Re: Finance::Quote Yahoo_JSON Alpha Vantage
> Message-ID: <2fde53e2-985e-0030-9b87-68b6f5f0ffc7 at gmail.com>
> Content-Type: text/plain; charset=utf-8; format=flowed
>
> I followed the instructions on adding modes for quote.pm and
> alphavantage.pm as described.? However, I am no longer able to update
> any my stocks now.? I have obviously done something wrong. Is there any
> way to undo these modes and revert back to my previous files?
>
> Thanks.
>
> Les
>
> On 04/01/2018 08:51 PM, Chris Good wrote:
> > Hi,
> >
> > I have no problems using Yahoo_JSON as a quote source for my 16 stocks
for
> > which I download prices only weekly.
> >
> > However, I have been working with another user and it seems Yahoo_JSON
> fails
> > when there are many stocks and/or prices for them are requested often.
> >
> >
> >
> > I suggest people who run into Yahoo _JSON problems use Alpha Vantage as
> the
> > quote source.
> >
> > See
> >
> https://wiki.gnucash.org/wiki/FAQ#Q:_Why_doesn.27t_online_quoting_work.3
> F
> >
> >
> >
> > Alpha Vantage purposefully fails quote requests if it detects a user
hogging
> > their web server resources by returning an Information message that
says:
> >
> > Please consider optimizing your API call frequency
> >
> > and pausing for approx. 20 seconds.
> >
> >
> >
> > If you use Alpha Vantage, there have been mods made to Finance::Quote so
> > that usage complies with the Alpha Vantage recommendations that only 1
> price
> > request per second is made in order to ensure that the webserver
resources
> > are shared amongst all users.
> >
> >
> >
> > If the information message is detected for a particular stock (or
currency
> > conversion thanks Mike Alexander), then Finance::Quote also pauses for
20
> > seconds, then retries up to 4 times.
> >
> > As this means you should not have to retry getting prices for all stocks
or
> > currencies if you have a failure, and this will minimise usage of the
Alpha
> > Vantage web server, I suggest people install the modified perl programs.
> >
> >
> >
> > The modified Finance::Quote perl programs are currently not yet
incorporated
> > into the latest version of Finance::Quote (1.47), and as the
Finance::Quote
> > maintainers are, like everyone else, busy, it may be a long time (it has
> > been over a year in the past) before these mods are included in the next
> > release of Finance::Quote.
> >
> >
> >
> > To install these mods without waiting for them to be incorporated in
> > Finance::Quote:
> >
> >
> >
> > 1. Make sure the standard Quote.pm and AlphaVantage.pm files are
writable.
> >
> >
> >
> > For Windows 10 these files are usually:
> >
> > C:\strawberry\perl\site\lib\Finance\Quote.pm
> >
> > C:\strawberry\perl\site\lib\Finance\Quote\AlphaVantage.pm
> >
> > Using File Manager, right click on the file, Properties, Untick 'Read
Only',
> > then OK
> >
> >
> >
> > For Ubuntu Linux, these files are usually:
> >
> > /usr/local/share/perl/5.22.1/Finance/Quote.pm
> >
> > /usr/local/share/perl/5.22.1/Finance/Quote/AlphaVantage.pm
> >
> > From a terminal:
> >
> > cd /usr/local/share/perl/5.22.1/Finance
> >
> > sudo chmod 666 Quote.pm Quote/AlphaVantage.pm
> >
> >
> >
> > 2. To install the modified Quote.pm:
> >
> > Open
> > https://raw.githubusercontent.com/mtalexander/finance-
> quote/6ee43ea08b504617
> > 142139fda41ae45be865fa38/lib/Finance/Quote.pm
> >
> > in a browser, click in the code, then use Control-A to highlight it
all,
> > then paste it into a text editor
> >
> > (say Notepad for Windows, or gedit for Linux), then 'Save As' over the
top
> > of the existing
> > Quote.pm.
> >
> >
> >
> > 3. To install the modified AlphaVantage.pm:
> >
> > Open
> > https://github.com/mtalexander/finance-
> quote/blob/6ee43ea08b504617142139fda4
> > 1ae45be865fa38/lib/Finance/Quote/AlphaVantage.pm
> >
> >
> >
> > in a browser, click in the code, then use Control-A to highlight it
all,
> > then paste it into a text editor
> >
> > (say Notepad for Windows, or gedit for Linux), then 'Save As' over the
top
> > of the existing
> > AlphaVantage.pm.
> >
> >
> >
> >
> > Sorry, I don't have a Mac so I cannot provide instructions.
> >
> >
> >
> > If you want to check on the progress of the Pull Request to incorporate
> > these changes in Finance::Quote, please see:
> >
> > https://github.com/finance-quote/finance-quote/pull/85
> >
> > Regards, Chris Good
Hi Les,
Sorry you had problems following my instructions.
The quickest way to reinstall the standard files over the modified files is:
>From a command prompt (Windows) or Terminal (Linux):
cpan
install Finance::Quote
quit
However, if you wish to tell me what your operating system is, and try to
run the gnc-fq-helper command as per
https://wiki.gnucash.org/wiki/FAQ#Q:_How_do_I_fix_a_.22system_error.22_or_.2
2unknown_error.22_when_getting_stock_quotes.3F
and tell me the response, I will try to help you.
I.e.
Windows from a command prompt:
cd \Program Files\gnucash\bin
echo (yahoo "CSCO") | perl gnc-fq-helper
Linux, from a terminal:
echo '(yahoo "CSCO")' | gnc-fq-helper
Regards, Chris Good
More information about the gnucash-user
mailing list