[GNC] Currency exchange rates retrieval with GC 3.2
John Ralls
jralls at ceridwen.us
Thu Sep 6 10:33:46 EDT 2018
> On Sep 6, 2018, at 12:15 AM, Manfred Usselmann <manfred at usselmann.de> wrote:
>
>
>
> Hi,
>
> I'm using GnuCash 3.2 with Finance::Quote 1.47 on Ubuntu 18.04.
>
> When trying to download currency exchange rates this fails with "Unknown
> error".
>
> I've registered an ALPHAVANTAGE_API_KEY and entered it on the settings
> screen.
>
> Some tests from the command line:
>
> $ GNC-FQ-DUMP -V ALPHAVANTAGE CHFEUR=X
> Finance::Quote fields Gnucash uses:
> symbol: CHFEUR=X <=== required
> date: 09/06/2018 <=== recommended
> currency: USD <=== required
> last: 0.8842 <=\
> nav: <=== one of these
> price: <=/
> timezone: <=== optional
>
> All fields returned by Finance::Quote for stock CHFEUR=X
>
> stock field value
> ----- ----- -----
> CHFEUR=X close: 0.8842
> CHFEUR=X currency: USD
> CHFEUR=X currency_set_by_fq: 1
> CHFEUR=X date: 09/06/2018
> CHFEUR=X high: 0.8847
> CHFEUR=X isodate: 2018-09-06
> CHFEUR=X last: 0.8842
> CHFEUR=X low: 0.8840
> CHFEUR=X method: alphavantage
> CHFEUR=X open: 0.8845
> CHFEUR=X success: 1
> CHFEUR=X symbol: CHFEUR=X
> CHFEUR=X volume: 0
>
> $ ECHO '(ALPHAVANTAGE "CSCO")' | GNC-FQ-HELPER
> (("CSCO" (symbol . "CSCO") (gnc:time-no-zone . "2018-09-05 12:00:00")
> (last . 47.2700) (currency . "USD")))
Does the CSCO price retrieval work in GnuCash?
I created a CHFEUR=X security, set it to retrieve quotes from Alphavantage, and successfully retrieved the price in GnuCash.
Note, however, that it’s not a meaningful value: CHFEUR=X retrieves the price in EUR of 1CHF, but Finance::Quote treats it as USD because Alphavantage doesn’t tell it otherwise.
Regards,
John Ralls
More information about the gnucash-user
mailing list