[GNC] Finance::Quote started multiplying prices by 100

Bruce Schuck bschuck at asgard-systems.com
Thu Sep 19 12:06:01 EDT 2024


On 9/19/24 6:46 AM, Martin Booth wrote:

> Downloading UK traded stock from Alphavantage you need to add an 'X' to 
> the symbol like

> CNA.L.X

> your prices will now be pounds.

Correct, I added the code to do this in AlphaVantage.pm last July. The 
comment in the source code explains the issue. John Ralls suggested the 
idea of having users add the ".X" suffix to stock symbols they know are 
traded in Pence instead of Pounds.

#   Since the JSON returned by the GLOBAL_QUOTE API does not specify
#   the currency of the price data, there is no way to determine the
#   correct currency without an additional call to the SYMBOL_SEARCH
#   API. To avoid even slower throttling, this module expects the
#   user to know which securities from certain countries may be traded
#   in the non-ISO4217 currency.
#   Example is LSE traded GBP.L and GBPG.L. GBP.L is traded in GBX,
#   which is also known as GBp, and GBPG.L is traded in the iso-4217
#   currency GBP (Great Britain Pounds).
#   The user will add ".X" to symbols to return GBX priced securities
#   as GBP.

For those wanting to see more on this issue see 
https://github.com/finance-quote/finance-quote/issues/281 and 
https://github.com/finance-quote/finance-quote/pull/326.

F::Q release v1.63 will be available soon (maybe this weekend). It 
contains a new module that gets data from https://financeapi.net that 
requires an API Key/Token. The free key from FinanceAPI allows 100 
queries per day. 4x as many allowed by the AlphaVantage free key. The 
"financeapi" method will use the key stored in the "FINANCEAPI_API_KEY" 
environment variable.

Thank you.

Bruce S.


More information about the gnucash-user mailing list