Quote date in gnucash different from retrieved by gnc-fq-dump
John Ralls
jralls at ceridwen.us
Wed Jul 29 20:08:00 EDT 2015
> On Jul 29, 2015, at 8:21 AM, Lt. Goose <ltgoose at gmail.com> wrote:
>
> El miércoles, 29 de julio de 2015, John Ralls <jralls at ceridwen.us <mailto:jralls at ceridwen.us>> escribió:
>
> > On Jul 29, 2015, at 4:43 AM, Lt. Goose <ltgoose at gmail.com <>> wrote:
> >
> > I'm getting unexpected results when updating quotes in gnucash 2.6.7
> > (updated yesterday). I've written my own quote source and integrated it
> > into Finance::Quote (1.37). It is recognized by gnucash so that I can
> > select it from within the program and use it to retrieve quotes.
> >
> > However, the date returned in the quote (2015-07-29 12:00:00, as can be
> > seen in debug trace messages [1]) is different from the one returned by
> > Finance::Quote (2015-07-28, see gnc-fq-dump output in [2]). Detailed output
> > of gnc-fq-dump can be seen in [3].
> >
> > Am I missing something or does gnucash use execution date to insert the
> > quote value? Should date string be formatted some other way? (I mimicked
> > yahoo quote return values). Is this the way it should work?
> >
> > I'd appreciate any insights on this matter.
> >
> > Thanks in advance.
> > Gus.
> >
> > -------
> >
> > [1] gnucash.trace.log output
> > * 13:27:16 DEBUG <gnc.scm> handling-request: (bolsamadrid ECR.BME REE.BME)
> > * 13:27:19 DEBUG <gnc.scm> results: ((ECR.BME (symbol . ECR.BME)
> > (gnc:time-no-zone . 2015-07-29 12:00:00) (last . 0.73) (currency . EUR))
> > (REE.BME (symbol . REE.BME) (gnc:time-no-zone . 2015-07-29 12:00:00) (last
> > . 72.48) (currency . EUR)))
> >
> >
> > [2] gnc-fq-dump output
> > C:\Program Files (x86)\gnucash\bin>perl gnc-fq-dump bolsamadrid REE.BME
> > ECR.BME
> > Finance::Quote fields Gnucash uses:
> > symbol: REE.BME <=== required
> > date: 28/07/2015 <=== required
> > currency: EUR <=== required
> > last: 72.4800 <=\
> > nav: <=== one of these
> > price: 72.4800 <=/
> > timezone: <=== optional
> > =====
> >
> > Finance::Quote fields Gnucash uses:
> > symbol: ECR.BME <=== required
> > date: 28/07/2015 <=== required
> > currency: EUR <=== required
> > last: 0.7300 <=\
> > nav: <=== one of these
> > price: 0.7300 <=/
> > timezone: <=== optional
> >
> >
> > [3] gnc-fq-dump verbose output
> > C:\Program Files (x86)\gnucash\bin>perl gnc-fq-dump -v bolsamadrid REE.BME
> > ECR.BME
> > Finance::Quote fields Gnucash uses:
> > symbol: REE.BME <=== required
> > date: 28/07/2015 <=== required
> > currency: EUR <=== required
> > last: 72.4800 <=\
> > nav: <=== one of these
> > price: 72.4800 <=/
> > timezone: <=== optional
> >
> > All fields returned by Finance::Quote for stock REE.BME
> >
> > stock field value
> > ----- ----- -----
> > REE.BME currency: EUR
> > REE.BME date: 28/07/2015
> > REE.BME day_range: 72.0400 - 72.6600
> > REE.BME high: 72.6600
> > REE.BME isodate: 2015/07/28
> > REE.BME last: 72.4800
> > REE.BME low: 72.0400
> > REE.BME method: bolsamadrid
> > REE.BME name: REE.BME
> > REE.BME p_change: 0.42
> > REE.BME price: 72.4800
> > REE.BME source: Finance::Quote::Bolsamadrid
> > REE.BME success: 1
> > REE.BME symbol: REE.BME
> >
> > =====
> >
> > Finance::Quote fields Gnucash uses:
> > symbol: ECR.BME <=== required
> > date: 28/07/2015 <=== required
> > currency: EUR <=== required
> > last: 0.7300 <=\
> > nav: <=== one of these
> > price: 0.7300 <=/
> > timezone: <=== optional
> >
> > All fields returned by Finance::Quote for stock ECR.BME
> >
> > stock field value
> > ----- ----- -----
> > ECR.BME currency: EUR
> > ECR.BME date: 28/07/2015
> > ECR.BME day_range: 0.6550 - 0.7450
> > ECR.BME high: 0.7450
> > ECR.BME isodate: 2015/07/28
> > ECR.BME last: 0.7300
> > ECR.BME low: 0.6550
> > ECR.BME method: bolsamadrid
> > ECR.BME name: ECR.BME
> > ECR.BME p_change: 9.45
> > ECR.BME price: 0.7300
> > ECR.BME source: Finance::Quote::Bolsamadrid
> > ECR.BME success: 1
> > ECR.BME symbol: ECR.BME
>
> By “updated yesterday” do you mean you built yesterday’s maint? That’s significant because I pushed a change on Monday to use a more modern interface for Date::Manip, and it looks like it’s not parsing the d-m-y format correctly.
>
> Regards,
> John Ralls
>
>
>
> I mean I updated gnucash from 2.6.3 to 2.6.7 using the Windows msi installer from the gnucash website. I installed this morning activeperl 5.20.2 (i think that's the version) over 5.20.1 and updated finance::quote using the Perl package manager from 1.10 to 1.37.
>
> I haven't built anything from source, but I can make any checks you suggest.
OK.
You can run gnc-fq-helper directly from the command line with
echo (source “SYM”) | perl c:\Program Files (x86)\gnucash\bin\gnc-fq-helper
as long as perl is on your path.
I think your problem is returning the date in D/M/YYYY format. That’s not a format Date::Manip, which gnc-fq-helper uses for date parsing, understands. Try YYYY/M/D instead.
You can read more at http://search.cpan.org/~sbeck/Date-Manip-6.50/lib/Date/Manip/Date.pod#VALID_DATE_FORMATS <http://search.cpan.org/~sbeck/Date-Manip-6.50/lib/Date/Manip/Date.pod#VALID_DATE_FORMATS>.
Regards,
John Ralls
More information about the gnucash-user
mailing list