Error retrieving price quotes

David Reiser dbreiser at icloud.com
Sun Dec 22 23:01:46 EST 2013


On Dec 22, 2013, at 3:39 AM, David Lynch <dlynch1319 at googlemail.com> wrote:

> On 21/12/2013 22:55, David Reiser wrote:
>> 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:
>>>> 
>>>>>   <snip>
>> 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.
>> <snip>
>> 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
> Many thanks for your explanation of why things are problematic.
> 
> I can easily download the prices I need in csv format from Trustnet (note: no symbols in the csv) :
> "
> ,,,,,Date,22-Dec-2013 09:14:50
> 
> Universe : Unit Trusts & OEICs
> Name,Purchase ,Bid,,Offer,Currency,Quantity,GBP Cost,GBP Value,Profit/loss,Profit/loss(%)
> Aviva Inv Corporate Bond 1,,,55.6400,,GBX,0.0000,0.00,0.00,0.00,0.00
> AXA Framlington Health R Inc,,1121.0000,,1184.0000,GBX,0.0000,0.00,0.00,0.00,0.00
> "
> This looks ad-free and more stable than the trustnet site. I'm happy writing or modifying Perl to parse this csv file. I'm worried about interfacing to GnuCash in case I corrupt my accounts. Is there guidance on the Finance::Quote GnuCash interface or the api's to use to load prices into GnuCash?
> 
> 
> David Lynch


The gnucash interface to finance-quote is in src/quotes. You might also see if the normal csv import can be expanded to include quotes. The csv import stuff is in src/import-export/csv-imp

IIRC the gnucash API info is all in internal comments in the code.
--
Dave Reiser
dbreiser at icloud.com







More information about the gnucash-user mailing list