[GNC] Currency lookup

Rainer Dorsch ml at bokomoko.de
Wed Nov 3 17:05:08 EDT 2021


A small adder:

The problem seems to be AlphaVantage related.

I switched for currency retrival to the European Central Bank (ECB)

rd at h370:/usr/share/doc/libfinance-quote-perl/examples$ cd /usr/bin/
rd at h370:/usr/bin$ diff -u gnc-fq-helper.orig gnc-fq-helper
--- gnc-fq-helper.orig  2021-01-06 10:07:35.000000000 +0100
+++ gnc-fq-helper       2021-11-03 21:58:07.339247496 +0100
@@ -323,7 +323,7 @@
 check_modules ();
 
 # Create a stockquote object.
-my $quoter = Finance::Quote->new();
+my $quoter = Finance::Quote->new(currency_rates => {order => ['ECB']});
 my $prgnam = "gnc-fq-helper";
 
 # Disable default currency conversions.
rd at h370:/usr/bin$ 

and my setup works as perfect as before.

Can anybody tell if there is a better way to switch to a different source than 
Alphavantage?

It seems thought that the set of currency conversion rates provided by the ECB 
is limited to:

https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml

Thanks
Rainer

Am Mittwoch, 3. November 2021, 20:58:25 CET schrieb Rainer Dorsch via gnucash-
user:
> Hi,
> 
> I added an account with KRW (Korean Won) to gnucash. Gnucash then tries to
> retrieve an exchange rate for KRW. Unfortunately, now finance-quote times
> out in the currency exchange rate request (sometimes after a very long
> time).
> 
> It is strange that even after deleting the account with KRW, gnucash still
> tries to request an exchange rate for KRW.
> 
> Also on the command line I see that many currencies work well, whereas the
> query for KRW hangs:
> 
> rd at h370:$ echo '(currency "CHF" "EUR")'|gnc-fq-helper
> (("CHF" (symbol . "CHF") (gnc:time-no-zone . "2021-11-02 22:49:17") (last .
> #e0.944) (currency . "EUR")))
> rd at h370:$ echo '(currency "DKK" "EUR")'|gnc-fq-helper
> (("DKK" (symbol . "DKK") (gnc:time-no-zone . "2021-11-02 22:49:42") (last .
> #e0.1343) (currency . "EUR")))
> rd at h370:$ echo '(currency "GBP" "EUR")'|gnc-fq-helper
> (("GBP" (symbol . "GBP") (gnc:time-no-zone . "2021-11-02 22:49:52") (last .
> #e1.1754) (currency . "EUR")))
> rd at h370:$ echo '(currency "SEK" "EUR")'|gnc-fq-helper
> (("SEK" (symbol . "SEK") (gnc:time-no-zone . "2021-11-02 22:49:57") (last .
> #e0.10027) (currency . "EUR")))
> rd at h370:$ echo '(currency "KRW" "EUR")'|gnc-fq-helper
> 
> Can somebody tell what is the mechanism for gnucash to request an
> exchange rate for a currency and how I can make it stop requesting KRW?
> 
> Is there a way log all gnucash fq requests to finance-quote or dump them on
> stdout?
> 
> Does anybody understand why
> 	echo '(currency "KRW" "EUR")'|gnc-fq-helper
> hangs?
> 
> Any hind or advice is welcome.
> 
> Thanks
> Rainer


-- 
Rainer Dorsch
http://bokomoko.de/




More information about the gnucash-user mailing list