On 26 Apr 2020, at 4:36, davygc wrote:

It seems that the quote for exchange rate is not handled by Alphavantage.pm
and the cause of the problem is the limitation of 5 quote per minute.

This is a bug in Finance::Quote which I fixed some time ago. My fix was merged into the master branch on March 21 and will presumably be in the next release of F::Q. In the meantime you can edit the file lib/Finance/Quote.pm (which is where currency quotes are handled) to change three occurrences of "Information" to "Note" around line 277. The patch is

        --- a/lib/Finance/Quote.pm
        +++ b/lib/Finance/Quote.pm
        @@ -274,9 +274,9 @@ sub currency {
                 if ( !$json_data || $json_data->{'Error Message'} ) {
                   return undef;
                 }
-# print "Failed: " . $json_data->{'Information'} . "\n" if (($try_cnt < 5) && ($json_data->{'Information'}));
        -        sleep (20) if (($try_cnt < 5) && 
($json_data->{'Information'}));
        -  } while (($try_cnt < 5) && ($json_data->{'Information'}));
+# print "Failed: " . $json_data->{'Note'} . "\n" if (($try_cnt < 5) && ($json_data->{'Note'}));
        +        sleep (20) if (($try_cnt < 5) && ($json_data->{'Note'}));
        +  } while (($try_cnt < 5) && ($json_data->{'Note'}));
        
my $exchange_rate = $json_data->{'Realtime Currency Exchange Rate'}->{'5. Exchange Rate'};
        

_______________________________________________
gnucash-user mailing list
gnucash-user@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.

Reply via email to