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 123312 - QIF Import: Autoselection of Stock Exchange during import
QIF Import: Autoselection of Stock Exchange during import
Status: VERIFIED FIXED
Product: GnuCash
Classification: Other
Component: Import - QIF
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: Benoit Grégoire
Benoit Grégoire
Depends on:
Blocks: backport
 
 
Reported: 2003-09-26 15:40 UTC by Spiritraveller
Modified: 2018-06-29 20:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
QIF with NYSE, NASDAQ and FUND symbol styles (837 bytes, text/plain)
2008-01-13 12:37 UTC, Charles Day
  Details
Proposed patch (2.64 KB, patch)
2008-01-13 12:47 UTC, Charles Day
none Details | Review
Proposed patch v2 (2.62 KB, patch)
2008-01-13 19:42 UTC, Charles Day
committed Details | Review

Description Spiritraveller 2003-09-26 15:40:35 UTC
When importing from a QIF, the user must manually select the stock
exchange for each security imported.

It would greatly enhance usability if 2 and 3 letter symbols
autoselected to NYSE and 4 letter symbols autoselected to NASDAQ. 
Anything longer than 5 letters could autoselect to FUND.  The user would
then have the ability to fix if the autoselection were wrong, but would
not have to select the correct exchange from a pull-down menu for every
single security that the user has ever traded.

Steps to reproduce the problem:
1. Import a QIF file that contains securities/stock transactions
2. Click through to the import of stocks and funds
3. Notice that no matter how many letters are in the symbol, the
exchange always defaults to NYSE, even though shares traded on NYSE are
never more than 3 letters long.
Comment 1 Steve Kelem 2005-08-16 21:11:22 UTC
Better yet, look up the symbol names.  There must be a way to do a web query, or
ship a file with the most common stocks and funds.
I have 118 securities in my QIF file. (I don't own that many, but the securities
show up if they're on Quicken's "watch list".)  I'm not going to look up each
stock/fund, one at a time...it would take hours.  That's what computers are for.
Comment 2 Bengt Thuree 2006-04-04 07:41:23 UTC
And what about all the other stock markets in the world?
I think there are a few more than NYSA and NASDAQ out there.

I am not sure that it is possible to automatically convert Quicken/Money's stock code to GnuCash (Yahoo).
Comment 3 Charles Day 2008-01-13 12:37:55 UTC
Created attachment 102731 [details]
QIF with NYSE, NASDAQ and FUND symbol styles

This file contains varying formats of NYSE, NASDAQ, and mutual fund symbols.
Comment 4 Charles Day 2008-01-13 12:47:32 UTC
Created attachment 102732 [details] [review]
Proposed patch

This patch provides a somewhat smarter default based on the ticker symbol:
-NYSE for symbols of 1-3 characters with an optional .X or .XX suffix
-NASDAQ for symbols of 4 characters
-FUND for symbols of 5 or more characters

If a smarter method of determination (perhaps leveraging the Internet) is added later, this code could still be useful as a last resort.
Comment 5 Charles Day 2008-01-13 12:55:13 UTC
As far as adding other stockmarkets goes, I think someone (not me) would have to develop an Internet lookup that asks the user to select among the available choices. Even a simple symbol like ABC represents at least three different companies on three different exchanges (NYSE, London, Bahrain).
Comment 6 Charles Day 2008-01-13 19:42:16 UTC
Created attachment 102757 [details] [review]
Proposed patch v2 

Whoops... this fixes the NYSE's XXX.XX case.
Comment 7 Derek Atkins 2008-01-20 17:05:57 UTC
I don't think this patch snippet is right:

                      (if (not ticker-symbol)
-			 (set! ticker-symbol stock-name))
+			 (set! ticker-symbol stock-name)
+                         (set! namespace
+                           (qif-dialog:default-namespace ticker-symbol)))

This means, effectively:   if ! ticker-symbol; then set! ticker-symbol stock-name ; else set! namespace qif-dialog:default-namespace ticket-symbol

I don't think this is what you want, is it?
Comment 8 Charles Day 2008-01-20 23:02:35 UTC
Yes, that's what I want - that is, I only want to analyze the ticker symbol (to guess at the namespace) if that ticker symbol is non-empty, i.e. the ticker symbol was included in the QIF file.

Otherwise, the ticker symbol gets defaulted to be the same as the stock name (this isn't a change) and the namespace gets defaulted to FUND in the "let" above it. I hope to enhance this default behavior soon via a separate "enhancement" bug (and patch) that will consider the QIF security "T" line (if any) when determining the default namespace. Example:

This namespace should default to FUND:
!Type:Security
NSecurity without a symbol
TMutual Fund
^

This namespace should default to STOCK:
!Type:Security
N2nd security without a symbol
TStock
^
Comment 9 Charles Day 2008-01-22 11:57:44 UTC
An enhancement request covering QIF securities without a symbol has been filed as bug #511231. In the meantime, this patch is good to go.
Comment 10 Charles Day 2008-02-22 18:30:26 UTC
Derek, I went ahead and committed this patch as r16950. Requesting backport for 2.2.4.
Comment 11 Andreas Köhler 2008-02-28 22:26:20 UTC
Applied to branches/2.2 as r16969 for GnuCash 2.2.4.
Thanks a lot!
Comment 12 John Ralls 2018-06-29 20:37:46 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=123312. Please update any external references or bookmarks.