Am Mittwoch, 10. März 2021, 05:04:34 CET schrieb John Ralls:
> > On Mar 9, 2021, at 1:08 PM, Rainer Dorsch <m...@bokomoko.de> wrote:
> > 
> > Hi John,
> > 
> > it seems currency retrieval does not work with finance-quote 1.50rc1 in
> > gnucash. currency-lookup.pl works though. I understand it is using
> > alphavantage.
> > 
> > Can you have a quick look at
> > https://github.com/finance-quote/finance-quote/ issues/173 ?
> > 
> > Is that because of  lack of support for the alphavantage key? For stocks
> > this seem to work though
> > 
> > rd@h370:/usr/share/doc/libfinance-quote-perl/examples$  echo
> > '(alphavantage
> > "MSFT")' | gnc-fq-helper
> > (("MSFT" (symbol . "MSFT") (gnc:time-no-zone . "2021-03-08 12:00:00")
> > (last . #e227.3900) (currency . "USD")))
> > rd@h370:/usr/share/doc/libfinance-quote-perl/examples$ gnc-fq-dump
> > alphavantage MSFT
> > 
> > Finance::Quote fields Gnucash uses:
> >    symbol: MSFT                 <=== required
> >    
> >      date: 03/08/2021           <=== recommended
> >  
> >  currency: USD                  <=== required
> >  
> >      last: 227.3900             <=\
> >      
> >       nav:                      <=== one of these
> >     
> >     price:                      <=/
> >  
> >  timezone:                      <=== optional
> > 
> > rd@h370:/usr/share/doc/libfinance-quote-perl/examples$
> 
> Ranier,
> 
> You need to set ALPHAVANTAGE_API_KEY in the shell in order to use
> gnc-fq-dump or gnc-fq-helper. To use it in GnuCash you set it in
> Preferences>Online Quotes.

Thanks for your quick response. I understood that I have to set 
ALPHAVANTAGE_API_KEY as an evironment variable on the command line. For some 
reason the command line works with stocks but not with currencies:

rd@h370:/usr/share/doc/libfinance-quote-perl/examples$ export 
ALPHAVANTAGE_API_KEY=<MY_KEY>
rd@h370:/usr/share/doc/libfinance-quote-perl/examples$  echo '(alphavantage 
"MSFT")' | gnc-fq-helper
(("MSFT" (symbol . "MSFT") (gnc:time-no-zone . "2021-03-09 12:00:00") (last . 
#e233.7800) (currency . "USD")))
rd@h370:/usr/share/doc/libfinance-quote-perl/examples$  echo '(currency "USD" 
"EUR")' | gnc-fq-helper
(#f)
rd@h370:/usr/share/doc/libfinance-quote-perl/examples$ 

even though 

rd@h370:/usr/share/doc/libfinance-quote-perl/examples$ ~/tmp.nobackup/currency-
lookup.pl USD EUR
USD->EUR = 0.8384
rd@h370:/usr/share/doc/libfinance-quote-perl/examples$ 

works (with the patch setting  ALPHAVANTAGE_API_KEY in currency-lookup.pl, as 
shown here https://github.com/finance-quote/finance-quote/issues/
173#issuecomment-793126311 ). This indicates that the information is correctly 
retrieved from Alphavantage, but the communication between finance-quote and 
gnc-fq-helper does not work properly.

Thanks
Rainer

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


_______________________________________________
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