After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 770132 - Price editor does not find ASX:XRO
Price editor does not find ASX:XRO
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Currency and Commodity
2.6.13
Other Windows
: Normal normal
: future
Assigned To: gnucash-core-maint
gnucash-core-maint
Depends on:
Blocks:
 
 
Reported: 2016-08-19 07:29 UTC by Gary Riddell
Modified: 2018-06-29 23:50 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Gary Riddell 2016-08-19 07:29:55 UTC
I retrieve many prices from ASX on a regular basis (currently over 50).
Each stock has "Multiple", Australia selected.
One stock - ASX:XRO - is not found.
I am a long time user and I have never seen this problem on any other stock.
I encountered the error on 2.6.12, and updated to 2.6.13 before reporting this. The error output is the same.

I did a little investigation:
1. I tried with "Single", Australian Stock Exchange, but no success.

2. In case it was a "last data item" problem, I added a stock further down the alphabet (YPB), but the app still reported the problem with ASX:XRO, and ASX:YPB was fetched OK.
Comment 1 Chris Good 2016-08-19 09:26:02 UTC
Hi Gary,

You're right, ASX doesn't work (maybe termporarily?) with XRO but yahoo does so I suggest you change the security quote source from australia to yahoo_australia (Single).

C:\Program Files (x86)\gnucash\bin>perl gnc-fq-dump -v yahoo_australia XRO
Finance::Quote fields Gnucash uses:
    symbol: XRO.AX               <=== required
      date: 08/19/2016           <=== required
  currency: AUD                  <=== required
      last: 18.91                <=\
       nav:                      <=== one of these
     price: 18.91                <=/
  timezone:                      <=== optional

All fields returned by Finance::Quote for stock XRO

stock           field  value
-----           -----  -----
XRO               ask: 18.96
XRO           avg_vol: 64686
XRO               bid: 18.77
XRO               cap: 2570000000
XRO             close: 18.99
XRO          currency: AUD
XRO              date: 08/19/2016
XRO         day_range: 18.66 - 19.00
XRO               div:
XRO          div_date:
XRO         div_yield:
XRO               eps: -0.44
XRO            ex_div:
XRO          exchange: Australian Stock Exchange
XRO              high: 19.00
XRO           isodate: 2016-08-19
XRO              last: 18.91
XRO               low: 18.66
XRO            method: yahoo_australia
XRO              name: XERO FPO NZX
XRO               net: -0.08
XRO              open: 19.00
XRO          p_change: -0.42
XRO                pe:
XRO             price: 18.91
XRO           success: 1
XRO            symbol: XRO.AX
XRO              time: 16:10
XRO            volume: 48209
XRO        year_range: 11.90 - 20.50


C:\Program Files (x86)\gnucash\bin>perl gnc-fq-dump -v australia XRO
Finance::Quote fields Gnucash uses:
    symbol: XRO                  <=== required
      date: ** missing **        <=== required
  currency: ** missing **        <=== required
      last: 18.910               <=\
       nav:                      <=== one of these
     price: 18.910               <=/
  timezone:                      <=== optional

** This stock quote cannot be used by gnucash!!


All fields returned by Finance::Quote for stock XRO

stock           field  value
-----           -----  -----
XRO               bid: -0.42%
XRO          exchange: Australian Stock Exchange
XRO              high: 19.000
XRO              last: 18.910
XRO               low: 19.000
XRO            method: asx
XRO             offer: 18.670
XRO              open: 19.000
XRO          p_change: -0.42
XRO             price: 18.910
XRO           success: 1
XRO            symbol: XRO
XRO            volume: 18.660

Note: In future you may like to ask on the GnuCash user email list before going to the trouble of adding a bug.

Regards, Chris Good
Comment 2 Frank H. Ellenberger 2016-08-19 20:51:42 UTC
Thanks for taking the time to report this.
However, Finance-Quote does not track its bugs in the GNOME GNOME Bugzilla. 

There is an open bug https://rt.cpan.org/Public/Bug/Display.html?id=97551 for Finance-Quote: Finance::Quote::ASX: Finance::Quote::ASX v1.35 seems to return incorrect values ...

Can one of you check the relationship?

Chris, am I right, you are the last author of ASX?

In this case I will delay closing this issue as NOTGNOME.

How do you think to proceed?
Comment 3 Chris Good 2016-08-20 22:27:37 UTC
Hi Gary and Frank,

Frank, Yes, I made a change to ASX.pm which was live in Finance::Quote 1.21.
1.38 is current version.
Erik Colson (eco - FQ maintainer) has made several changes since then.

I don't think cpan bug 97551 is related but I've only had a cursory look at that so far.

Gary, I don't understand when you say ASX:YPB works for you, as for me (FQ 1.27) it also fails because of missing date. Can you please confirm your security source for YPB and post the output of 'perl gnc-fq-dump -v australia YPB'. What OS version are you using?

In fact, all my stocks now fail with missing date when using ASX as source, but I use multiple source ASX, then Yahoo so I don't know how long it has failed with ASX as Yahoo still works.

XRO fails with missing date AND currency.
Is XRO only a new security code?
I have seen this problem in the past with new codes, then ASX fixes it after a short time.
Comment 4 Gary Riddell 2016-08-20 23:05:55 UTC
Hi Chris,

I decided to set up a new file with minimal number of accounts to investigate/demonstrate the problem.

As often happens with IT (Murphy's Law, corollary 5), I ran into another problem: When I create a new GnuCash file with all default options in the creation dialog, I get a file where ASX does not appear in the list of available exchanges. The documantation appears to state that it is one of the supported exchanges.

If you can help me get past this, I will create a small file with various combinations of stocks, and will be able to answer your questions, and send you files without my financial details in them.

Regards, Gary
Comment 5 Chris Good 2016-08-20 23:25:22 UTC
Ah! I see gnc-fq-helper defaults the date to current date, so GnuCash can use a quote with missing date even though gnc-fq-dump says it cannot.

Gary,
Thanks but I understand now why YPB works so I don't need your test file.
I had a look at ASX and it looks like XRO is not a new security.
I'll do some investigation into why FQ cannot find currency in the ASX web page for XRO.
Comment 6 Chris Good 2016-08-21 04:21:36 UTC
FYI I’ve fixed problem bug https://rt.cpan.org/Public/Bug/Display.html?id=97551 and created pull request https://github.com/finance-quote/finance-quote/pull/41 so hopefully this will be fixed in the next release of Finance::Quote (1.39?).

Note that this does not affect GnuCash as the only fields with the wrong data in them are not used by GnuCash.

I still need to investigate why FQ cannot find currency in the ASX web page for XRO.
Comment 7 Chris Good 2016-08-21 10:04:55 UTC
ASX.pm specifically puts currency AUD on all quotes, except those where the asx code starts with X as it assumes all starting with X are an index, not a share.

Tomorrow I'll make a mod to specifically cater for the 11 asx codes which start with X but are securities, not indexes (indices?).
These are listed at www.asx.com.au/asx/research/listedCompanies.do.
Indexes are listed at http://www.asx.com.au/products/index-charts.htm

Regards, Chris Good
Comment 8 Chris Good 2016-08-23 01:23:04 UTC
I've made the mod to ASX.pm and it works in my testing.
However, I also tried to create some more tests (in t/asx.t) to ensure this feature continues to work after any future mods, and for some reason unknown to me, the tests fail, so I have not submitted a pull request for my mods yet.

I've asked for help from the F::Q people:
https://github.com/finance-quote/finance-quote/issues/42.

Gary,

My mods should work fine for you. So you don't have to wait for the next F::Q release:
Go to http://pastebin.com/7QBycrw0 and click the Raw button. use Ctrl-A to highlight all the code, then create new file say ...Documents\ASX.pm in notepad and paste the code in, then Save. Ensure it's called ASX.pm, not ASX.pm.txt.
Open Windows Explorer (or File Explorer if you're using Windows 10). Right click on C:\strawberry\perl\site\lib\Finance\Quote
and in Properties, turn off READ-ONLY. Take a backup copy of
C:\strawberry\perl\site\lib\Finance\Quote\ASX.pm. Now use Windows/File Explorer to copy ...Documents\ASX.pm and paste to C:\strawberry\perl\site\lib\Finance\Quote\ASX.pm.

I suggest using this long-winded method to be sure you don't fall into Windows VirtualStore trap. Refer 
http://answers.microsoft.com/en-us/windows/forum/windows_vista-files/cusersuserappdatalocalvirtualstore-this-folder-is/619bd162-e0be-45c2-bf26-860d5a56522d

I couldn't use the pastebin Download button as something (I'm not sure if it was my Bitdefender anti-virus program or Windows itself) would not allow it.

Frank,
I'll update this bug when the fixes are incorporated into F::Q.

Regards, Chris Good
Comment 9 Gary Riddell 2016-08-23 01:44:29 UTC
Chris,

Thanks for your efforts on this. I have a working solution now, and I've learned a bit about F::Q in th process.

Cheers,
Gary
Comment 10 Chris Good 2017-03-23 00:48:42 UTC
Update: Still no help re-issue 42 or any sign of a new finance-quote release.
I hope it will still be maintained.
Comment 11 Frank H. Ellenberger 2018-02-06 22:39:34 UTC
Hi, Gary and Chis,

I am confused by the different related issues and patches and PRs on rt.cpan and github. But in between we got a bunch of F::Q releases. So my questions:

Is the fix now released, so we can close this bug.
Do we need some additional documentation in Gnucash?

TIA
FRank
Comment 12 Chris Good 2018-02-09 23:04:30 UTC
The fix to add currency AUD to specific ASX stock codes beginning with X (eg XRO) which are not indexes, was included in FQ 1.41, so this bug can be closed.

Unfortunately, the ASX website is only working sometimes. And then only with a small no of stocks in 1 go.
I intend to investigate but currently have no available time.

As this issue is ongoing, I don't think any additional documentation is appropriate yet.
Comment 13 Frank H. Ellenberger 2018-02-10 00:50:51 UTC
Thanks, Chris!

I add a note in helps appendix: commit 24a1855 in maint.
Comment 14 John Ralls 2018-06-29 23:50:39 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=770132. Please update any external references or bookmarks.