Skip Menu |

This queue is for tickets about the Finance-Quote CPAN distribution.

Report information
The Basics
Id: 102637
Status: resolved
Worked: 10 min
Priority: 0/
Queue: Finance-Quote

People
Owner: eco [...] ecocode.net
Requestors: hemanshusubs [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: currency missing in yahoo_json
Date: Sun, 8 Mar 2015 16:25:44 +0530
To: bug-finance-quote [...] rt.cpan.org
From: Hemanshu Kumar <hemanshusubs [...] gmail.com>
Hi I am using Finance::Quote version 1.37 with GnuCash 2.6.5 on a Mac OS X 10.10.2 machine. I am trying to obtain stock quotes using yahoo_json. However, I always get the currency as “*missing*” and the quote is unusable by GnuCash. As an example, here is the output from  $gnc-fq-dump yahoo_json ITC.NS Finance::Quote fields Gnucash uses:     symbol: ITC.NS               <=== required       date: 03/05/2015           <=== required   currency: ** missing **        <=== required       last: 346.250000           <=\               nav:                      <=== one of these      price:                      <=/           timezone:                      <=== optional ** This stock quote cannot be used by gnu cash!! This is not limited to Indian stock quotes. I tried getting the quote for AMZN and AAPL, and get similar results. Please resolve this asap! Thanks for your help! regards Hemanshu Kumar
Is it possible for you to use something other than yahoo_json? There is no currency field produced by yahoo_json You can see here what it gives us: http://finance.yahoo.com/webservice/v1/symbols/ITC.NS/quote?format=json name: "ITC LTD-DEP SETT", price: "346.250000", symbol: "ITC.NS", ts: "1425549599", type: "equity", utctime: "2015-03-05T09:59:59+0000", volume: "13666265"
yahoo_json has the added value that it works for probably all symbols available through yahoo website by using a supported api. In example, it will return quotes for .NS and .BO markets, which other yahoo_sources don't (I've also written another yahoo module "yahoo_yql" which queries the YQL for quotes, but that also doesn't support .NS nor .BO). Backside of yahoo_json is that it only returns very limited info, not including the currency. For the moment yahoo_json doesn't return a currency and leaves that to the user. As GnuCash seems to need one, we can think of returning currencies in a hardcoded way. For example, when there is no suffix as in YHOO, MSFT, AAPL etc we can return 'USD'. For suffixes .BR and .PA we can return 'EUR' and we can also add some others... But there might be exceptions for which the returned currency will then be wrong. Although I don't know exceptions.. I'll leave this open for the moment to read comments/ideas. -- Erik
Subject: Re: [rt.cpan.org #102637] currency missing in yahoo_json
Date: Tue, 10 Mar 2015 09:23:03 +0530
To: bug-finance-quote [...] rt.cpan.org
From: Hemanshu Kumar <hemanshusubs [...] gmail.com>
Ben, Until about two years ago, yahoo and yahoo_asa used to work fine for India. Then Yahoo stopped supporting the service for Indian stock exchanges, and things have been in a limbo ever since. There are one or two user-created alternatives; see for instance http://maruhgar.blogspot.in/2013/11/updating-indian-stock-exchange-data-in.html However, there are at least a couple issues with this: (a) I’ve had some problems retrieving quotes using those modules — they seem to fail randomly, and pick up the wrong security in some instances (see my comment at the end of that blog post page) (b) they disappear when I update GnuCash and/or Finance::Quote — not nice for a simple end-user like me with zero perl skills. From: Ben Marsh via RT <bug-finance-quote@rt.cpan.org> Reply: bug-finance-quote@rt.cpan.org <bug-finance-quote@rt.cpan.org>> Date: 9 March 2015 at 7:43:58 am To: hemanshusubs@gmail.com <hemanshusubs@gmail.com>> Subject:  [rt.cpan.org #102637] currency missing in yahoo_json <URL: https://rt.cpan.org/Ticket/Display.html?id=102637 > Is it possible for you to use something other than yahoo_json? There is no currency field produced by yahoo_json You can see here what it gives us: http://finance.yahoo.com/webservice/v1/symbols/ITC.NS/quote?format=json name: "ITC LTD-DEP SETT", price: "346.250000", symbol: "ITC.NS", ts: "1425549599", type: "equity", utctime: "2015-03-05T09:59:59+0000", volume: "13666265"
On Mon Mar 09 06:36:02 2015, ecocode wrote: Show quoted text
> yahoo_json has the added value that it works for probably all symbols > available through yahoo website by using a supported api. In example, > it will return quotes for .NS and .BO markets, which other > yahoo_sources don't (I've also written another yahoo module > "yahoo_yql" which queries the YQL for quotes, but that also doesn't > support .NS nor .BO). Backside of yahoo_json is that it only returns > very limited info, not including the currency. > > For the moment yahoo_json doesn't return a currency and leaves that to > the user. As GnuCash seems to need one, we can think of returning > currencies in a hardcoded way. For example, when there is no suffix as > in YHOO, MSFT, AAPL etc we can return 'USD'. For suffixes .BR and .PA > we can return 'EUR' and we can also add some others... But there might > be exceptions for which the returned currency will then be wrong. > Although I don't know exceptions.. > > I'll leave this open for the moment to read comments/ideas.
Thats a possiblity. You know more than I. .NS is National Stock Exchange of India? I was going to say that since the data comes from Yahoo USA domain, the prices would be in USD. I would probably be wrong. We could hard code currencies for the suffices we know and add more as we figure out what currencies they should be.
Subject: Re: [rt.cpan.org #102637] currency missing in yahoo_json
Date: Tue, 10 Mar 2015 14:46:51 +0530
To: bug-finance-quote [...] rt.cpan.org
From: Hemanshu Kumar <hemanshusubs [...] gmail.com>
India has two principal stock exchanges: National Stock Exchange of India and the Bombay Stock Exchange. On Yahoo, the symbols for securities traded on these exchanges have the extensions .NS and .BO, respectively. And no, the numbers reported by yahoo_json for such securities are in Indian rupees (INR) not USD. From: Ben Marsh via RT <bug-finance-quote@rt.cpan.org> Reply: bug-finance-quote@rt.cpan.org <bug-finance-quote@rt.cpan.org>> Date: 10 March 2015 at 2:42:05 pm To: hemanshusubs@gmail.com <hemanshusubs@gmail.com>> Subject:  [rt.cpan.org #102637] currency missing in yahoo_json <URL: https://rt.cpan.org/Ticket/Display.html?id=102637 > On Mon Mar 09 06:36:02 2015, ecocode wrote: Show quoted text
> yahoo_json has the added value that it works for probably all symbols > available through yahoo website by using a supported api. In example, > it will return quotes for .NS and .BO markets, which other > yahoo_sources don't (I've also written another yahoo module > "yahoo_yql" which queries the YQL for quotes, but that also doesn't > support .NS nor .BO). Backside of yahoo_json is that it only returns > very limited info, not including the currency. > > For the moment yahoo_json doesn't return a currency and leaves that to > the user. As GnuCash seems to need one, we can think of returning > currencies in a hardcoded way. For example, when there is no suffix as > in YHOO, MSFT, AAPL etc we can return 'USD'. For suffixes .BR and .PA > we can return 'EUR' and we can also add some others... But there might > be exceptions for which the returned currency will then be wrong. > Although I don't know exceptions.. > > I'll leave this open for the moment to read comments/ideas.
Thats a possiblity. You know more than I. .NS is National Stock Exchange of India? I was going to say that since the data comes from Yahoo USA domain, the prices would be in USD. I would probably be wrong. We could hard code currencies for the suffices we know and add more as we figure out what currencies they should be.
support will be added in version 1.38 -- Erik