Finance-Quote 1.47 Unable to retrieve Currency quotes

Adriano Baldi adriano.baldi at gmail.com
Tue Feb 27 08:14:58 EST 2018


Hello to all


After some test I finally ad a delay of 30s delay between two subsequent
downloads.
With this delay the error disappear.

--------------------- Quote.pm --------------------------
...
  # Don't know if these have to be in upper case, but it's
  # better to be safe than sorry.
  $to = uc($to);
  $from = uc($from);

  return $amount if ($from eq $to); # Trivial case.

  my $ua = $this->user_agent;

  my $ALPHAVANTAGE_API_KEY = $ENV{'ALPHAVANTAGE_API_KEY'};
  return undef unless ( defined $ALPHAVANTAGE_API_KEY );

  sleep 30;   <============= ADD THIS

  my $reply = $ua->request(GET "${ALPHAVANTAGE_CURRENCY_URL}"
    . "&from_currency=" . ${from}
    . "&to_currency=" . ${to}
    . "&apikey=" . ${ALPHAVANTAGE_API_KEY} );
....
-----------------------------------------------------------

We are far, from having found the solution but at least I have found a
temporary solution to the problem.
With the hope that the "Maestro" (Italian term) Erik Colson will intervene
for the benefit of everyone with one of his magic codes.

Best regards

     Adriano

2018-02-23 2:09 GMT+01:00 Les <lelliott5 at gmail.com>:

> Thanks for the explanation Larry.  Now I understand.  I just don't know
> why I am unable to update currency quotes since 02/13/2018. Perhaps
> Alphavantage is just not robust enough to support all the users of GC plus
> what they were supporting before Yahoo went south last year.
>
> I appreciate what Erik Colson was able to put together in such a very
> short time. And Alphavantage seems to be the only game in town for the time
> being. All of the developers of GC need a big round of applause for keeping
> GC moving forward and answering all of the questions from users.
>
> Les
>
>
> On 02/22/2018 05:29 PM, ln.mailinglists at iinet.net.au wrote:
>
>> If you take a look in the Quote.pm perl module, the currency
>> conversion method calls the alpha vantage CURRENCY_EXCHANGE_RATE
>> function. As far as I can see this is the *only* source of exchange
>> rate data available in Finance::Quote (at least assuming you are using
>> version 1.47). Given this, any setting in gnucash is unlikely to
>> change anything (and is probably why gnucash reverts to currency no
>> matter what you do - it's the one data source that binds them all when
>> it comes to currency).
>> Also see the following post from Erik Colson (FQ developer)
>> https://sourceforge.net/p/finance-quote/mailman/message/36112625/
>> And finally, if you want to prove it for yourself, run currency
>> conversion with and without the alpha vantage key set.
>> Cheers,
>> Larry
>>
>>         Maybe I am missing something but when I go to Security Editor,
>> click
>> on
>>
>>         currencies and then select unknown and then alphavantage and save
>> it
>>
>>         reverts back to single, currency. So how is the quote (when I get
>> one)
>>
>>         coming from alphavantage?
>>
>>         Confused,
>>
>>         Les
>>
>>         On 02/22/2018 03:09 AM, ln.mailinglists at iinet.net.au [1]
>> wrote:
>>
>>         >_ Hi Richard, _
>>
>>         >_ It's definitely alphavantage for currency - you can check the
>> data
>> URL _
>>
>>         >_ early in the Quote.pm module. _
>>
>>         >_ I'd agree with Adriano's assessment that the problem is server
>> side. _
>>
>>         >_ I did a test this morning where I repeatedly requested quotes
>> from
>> _
>>
>>         >_ gnucash - the first four attempts sucessfully grabbed all of my
>> stock _
>>
>>         >_ values but failed on USD/AUD exchange rates, while the fifth
>> test
>> got _
>>
>>         >_ everything. _
>>
>>         >
>>
>>         >_ Cheers, _
>>
>>         >_ Larry _
>>
>>         >
>>
>>         >_ Date: Wed, 21 Feb 2018 11:24:25 +0000 _
>>
>>         >_ From: Richard Morris _
>>
>>         >_ To: Adriano Baldi _
>>
>>         >_ Cc: gnucash-user _
>>
>>         >_ Subject: Re: Finance-Quote 1.47 Unable to retrieve Currency
>> quotes
>> _
>>
>>         >_ Message-ID: _
>>
>>         >
>>
>>         >_ Content-Type: text/plain; charset="UTF-8" _
>>
>>         >_ But I wonder - does GNUCash use alphavantage for currencies? _
>>
>>         >_ I see this: _
>>
>>         >_ "There are 3 types of sources of which the first - currency -
>> is _
>>
>>         >_ hardcoded _
>>
>>         >_ and responsible to fetch ISO currencies. The other two can be
>> selected _
>>
>>         >_ in _
>>
>>         >_ the security editor." _
>>
>>         >_ https://www.gnucash.org/docs/v2.6/C/gnucash-help/apas01.html
>> [2] _
>>
>>         >_ I'm still having the issue with currencies. How about you
>> Adriano?
>> _
>>
>>         >_ And isn't it odd that gnc-fq-dump currency USD EUR (for
>> example) _
>>
>>         >_ works? _
>>
>>         >_ _______________________________________________ _
>>
>>         >_ gnucash-user mailing list _
>>
>>         >_ gnucash-user at gnucash.org [3] _
>>
>>         >_ To update your subscription preferences or to unsubscribe: _
>>
>>         >_ https://lists.gnucash.org/mailman/listinfo/gnucash-user [4] _
>>
>>         >_ If you are using Nabble or Gmane, please see
>> https://wiki.gnucash.org/wiki/Mailing_Lists [5] for more information.
>> _
>>
>>         >_ ----- _
>>
>>         >_ Please remember to CC this list on all your replies _
>>
>>         >_ You can do this by using Reply-To-List or Reply-All._
>>
>> Links:
>> ------
>> [1] https://lists.gnucash.org/mailman/listinfo/gnucash-user
>> [2] https://www.gnucash.org/docs/v2.6/C/gnucash-help/apas01.html
>> [3] https://lists.gnucash.org/mailman/listinfo/gnucash-user
>> [4] https://lists.gnucash.org/mailman/listinfo/gnucash-user
>> [5] https://wiki.gnucash.org/wiki/Mailing_Lists
>>
>> _______________________________________________
>> gnucash-user mailing list
>> gnucash-user at gnucash.org
>> To update your subscription preferences or to unsubscribe:
>> https://lists.gnucash.org/mailman/listinfo/gnucash-user
>> If you are using Nabble or Gmane, please see
>> https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
>> -----
>> Please remember to CC this list on all your replies.
>> You can do this by using Reply-To-List or Reply-All.
>>
>
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> If you are using Nabble or Gmane, please see
> https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.


More information about the gnucash-user mailing list