Error retrieving price quotes
David Reiser
dbreiser at icloud.com
Sat Dec 21 17:55:41 EST 2013
On Dec 21, 2013, at 4:05 PM, David Lynch <dlynch1319 at googlemail.com> wrote:
> On 21/12/2013 17:39, Fred Bone wrote:
>
> Many thanks for your reply: comments are interspersed.
>> On 21 December 2013 at 16:29, David Lynch said:
>>
>>> I am a new user of GnuCash, 2.4.13 on Windows Vista Sp2.
>>>
>>> I am running GnuCash Portable. I think I have installed Finance::Quote
>>> correctly (but I can't see how to verify this or find the version). I have
>>> installed Perl 5.16.3 on the portable disc.
>>>
>>> I have a security
>>> """"""""""
>>> Security Information
>>> Full name: Aviva Inv Corporate Bond 1
>>> Symbol/abbreviation: NA92
>>> Type: FUND
>>> ISIN, CUSIP or other code: GB0004459359
>>> Fraction traded: 1/ 100000
>>> Quote Source Information
>>> / Get Online Qotes
>>> Type of quote source
>>> * Single: Trustnet, GB
>>> Timezone: Europe/London
>>> """"""""""
>>> When I click Get Quotes in the Price Editor, I get a command line widow
>>> appear with Perl, it then disappears without any text in the window. I
>>> get a window in GnuCash "There was an unknown error while retrieving the
>>> price quotes".
>>>
>>> I have googled similar reports and tried to follow the advice ...
>>> without progress.
>> Running gnc-fq-dump from the Windows command line gets me
>
>>> C:\Program Files\gnucash\bin>perl gnc-fq-dump trustnet NA92
>>> No results found for stock NA92.
>> (and the same if I specify the ISIN instead)
>> and if I try suffixing with the usual ".L" (for LSE):
>>
>>> C:\Program Files\gnucash\bin>perl gnc-fq-dump trustnet NA92.L
>>> No results found for stock NA92.L.
>> which suggests that Trustnet doesn't provide data for this fund.
>>
>> Have you reason to think that it should do?
> Yes, I have been using it to update my previous Quicken accounts for the last ten years:
> http://www.trustnet.com/Tools/Portfolio/Valuation.aspx?selectPortfolio=2001086371
> contains:
> Aviva Inv Corporate Bond 1 -- -- GBX -- 55.64 -- -- --
That link requires a login, at least when I attempted to follow it. Trustnet requires that I agree to its Cookie policy before they'll let me see the alternate page when I try to follow that link. I don't think any of the finance-quote modules can handle logins.
>> I note that uk.finance.yahoo.com recognises the ISIN (when suffixed with
>> ".L") but not the symbol you give, and gives very little data.
>>
> I got the ISIN from
> http://www.digitallook.com/cgi-bin/dlmedia/security.cgi?csi=36252&action=fund_charts&username=&ac= <http://www.digitallook.com/cgi-bin/dlmedia/security.cgi?csi=36252&action=fund_charts&username=&ac=>
> "Aviva Investors Corporate Bond 1 NAV
> IMA Sector: Corporate Bond ISIN: GB0004459359 Fund Type: OEIC
> Add To Portfolio
> Henderson News
>
> 55.64p "
>
> The "NA92" is the CITICODE from
> http://www.trustnet.com/Factsheets/Factsheet.aspx?fundCode=NUSTB&univ=U <http://www.trustnet.com/Factsheets/Factsheet.aspx?fundCode=NUSTB&univ=U>
>
> " Bid Offer Date Yield OCF help Citicode SEDOL
> pdf AVIVA INV CORPORATE BOND A INC 52.09 (p) 20-Dec-2013 3.35 1.12% GN67 3249468
> pdf AVIVA INV CORPORATE BOND 1 INC 55.64 (p) 20-Dec-2013 3.66 0.82% NA92 0445935"
>
> ==================
>
> I tried to use yahoo instead of Trustnet:
>
> I tried:
> * single Yahoo Europe
> multiple
> * Europe (Yahoo, ...)
> and got:
> Unable to retrieve quotes for these items:
> FUND:GB0004459359.L
> Continue using only the good quotes?
>
> =============================
> I have tried various codes and various sources and have been unable to get anything that can be used by gnucash. The best I have done is:
> J:\PortableApps\GnuCashPortable\App\GnuCash\bin>perl gnc-fq-dump usa RHAT
> Finance::Quote fields Gnucash uses:
> symbol: RHAT <=== required
> date: ** missing ** <=== required
> currency: ♂ <=== required
> last: 0.00 <=\
> nav: <=== one of these
> price: <=/
> timezone: <=== optional
>
> ** This stock quote cannot be used by gnucash!!
>
> Is there or can you provide an example that works which I might be able to adapt?
>
> David Lynch
> I
I believe you are running into an intellectual property dispute between data driven consumers and advertising/tracking driven 'suppliers'. The European fund companies were among the first to force Yahoo to delete their quotes from the data-only feeds. But many other sources have followed their lead. Apparently sometime this year, two big exchanges in India pulled all their data out of Yahoo's quotes.csv service.
http://finance.yahoo.com/q?s=GB0004459359.L&ql=1
the address that displays in a browser if you go to Yahoo Finance and search for GB0004459359 will show you the information you want, but not in the form you'd like it to be in
http://finance.yahoo.com/d/quotes.csv?&s=GB0004459359.L&f=sl1d1t1c1ohgv&e=.csv
The form of the address as constructed by finance-quote, results in a bunch of N/A values in the returned data stream.
http://download.finance.yahoo.com/d/quotes.csv?s=IBM&f=sl1d1t1c1ohgv&e=.csv
works fine to retrieve IBM data. So "IBM" (without the quotes, capitalization matters) as the symbol in gnucash should work. I've never used Gnucash Portable, though.
http://ichart.finance.yahoo.com/table.csv?s=GB0004459359.L&d=11&e=21&f=2013&g=d&a=11&b=20&c=2013&ignore=.csv
shows some promise, but I see no way to have the symbol returned with the data, so you'd be limited to one quote at a time, or a lot of perl programming. You'd also have to know what currency is being used. (Yahoo web page displays pence, but the ichart values are pounds.)
Because the fund companies don't want you to be able to download data without paying for it with at least the need to parse your data among ads (or allowing them to put a tracking cookie on your machine), it will be difficult to get the data you want from finance-quote.
You're faced with writing a screen scraping module for finance-quote. And you're probably faced with modifying it multiple times a year when each fund changes the way they display the data among all the ads. There are some screen scraping modules in finance-quote. But I can't remember offhand which ones they are.
--
Dave Reiser
dbreiser at icloud.com
More information about the gnucash-user
mailing list