Problems getting quotes for funds
Richard Ullger
rullger at ntlworld.com
Wed Mar 12 20:32:36 EDT 2008
Hi Dave,
I've reverted to the original base.pm and applied the changes in the
diff. I notice that there is no change to
@FIELD_ENCODING = qw/s n l1 d1 t1 c1 p2 v b a p o m w e r r1 d y j1 q a2
c4/;
Behaviour has reverted back to the original problem where gnucash is
displaying the error 'unable to retrieve quotes for these items:' and
lists the fund symbols.
gnc-fq-dump produces the following output:
C:\Program Files\gnucash\bin>perl -w gnc-fq-dump yahoo_europe HSBA.L
Finance::Quote fields Gnucash uses:
symbol: HSBA.L <=== required
date: 03/12/2008 <=== required
currency: GBP <=== required
last: 7.955 <=\
nav: <=== one of these
price: 7.955 <=/
timezone: <=== optional
C:\Program Files\gnucash\bin>perl -w gnc-fq-dump yahoo_europe
GB0031860934GBP
No results found for stock GB0031860934GBP, but results were returned for
the stock(s) GB0031860934.L. Printing data for the first stock returned.
Finance::Quote fields Gnucash uses:
symbol: GB0031860934GBP <=== required
date: 03/11/2008 <=== required
currency: GBP <=== required
last: 5.2034 <=\
nav: <=== one of these
price: 5.2034 <=/
timezone: <=== optional
However, on closer inspection, replacing the GBP at the end of the
symbol with .L is what's causing the latest problem. I applied a further
change to base.pm so that $exchange still gets set but leaves $symbol
intact with GBP at the end. This fixes the problem and gnucash is then
able to load the fund quotes.
In the absence of a diff command in xp (that I know of) the change I
applied is:
my $symbol = $q[0];
# $symbol =~ s/GBP$/.L/;
# my ($exchange) = $symbol =~ m/\.([A-Z]+)/;
my ($symboltmp) = $symbol;
$symboltmp =~ s/GBP$/.L/;
my ($exchange) = $symboltmp =~ m/\.([A-Z]+)/;
# Strip out suffixes. Mmmm, functions as lvalues.
No change is required to the @FIELD_ENCODING line.
This then gives the gnc-fq-dump output:
C:\Program Files\gnucash\bin>perl -w gnc-fq-dump yahoo_europe
GB0031860934GBP
Finance::Quote fields Gnucash uses:
symbol: GB0031860934GBP <=== required
date: 03/11/2008 <=== required
currency: GBP <=== required
last: 5.2034 <=\
nav: <=== one of these
price: 5.2034 <=/
timezone: <=== optional
Thanks for your help.
Regards,
Richard.
David Reiser wrote:
> On Mar 12, 2008, at 4:39 PM, David Reiser wrote:
>
>> Does two ugly hacks equal a fix?
>>
>> When I sent out the first hack, I assumed that success of gnc-fq-
>> dump = success for Get Quotes inside gnucash. Oops. It turns out
>> that gnucash wasn't totally silent, just mumbling in the background
>> about no currency being assigned. When I accommodated
>> yahoo_europe's new timespec field, I didn't bother matching the
>> number of elements in @FIELDS and @FIELD_ENCODING lists. gnc-fq-
>> dump didn't have a problem with that, but gnucash does. My second
>> hack is just to add a second request for currency at the end of the
>> encoding list. I have tested this inside gnucash, and it does work
>> for European funds identified by isin.
>>
>> REMEMBER: this hack definitely breaks Yahoo US (and most likely
>> Yahoo Asia and Australia too). But if you can get all the rest of
>> your quotes from either Yahoo_Europe or non-Yahoo sources, then it
>> can retrieve quotes for isin identified funds. Instead of MFEXPG.L,
>> you'll have to enter GB0003243465GBP as the 'ticker'.
>>
>> This 'fix' is still ugly almost beyond belief, but it might be
>> useful to some. There is a different patch in the Finance-Quote bug
>> tracker, but it breaks non-European Yahoos as well.
>>
>> Dave
>> <yahoofix.diff>
>
> Rats. That isn't enough either. At this point, it looks like the
> finance-quote bug tracker patch
> http://sourceforge.net/tracker/download.php?group_id=4232&atid=104232&file_id=269562&aid=1910138
> is a better bet than my attempts.
>
> The latest problem being that quotes in pence aren't trapped and
> converted to pounds.
>
> Dave
> --
> David Reiser
> dbreiser at earthlink.net
>
>
>
>
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.
>
More information about the gnucash-user
mailing list