Index: src/import-export/qif-import/qif-dialog-utils.scm
===================================================================
--- src/import-export/qif-import/qif-dialog-utils.scm	(revision 16851)
+++ src/import-export/qif-import/qif-dialog-utils.scm	(working copy)
@@ -582,6 +582,38 @@
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;  qif-dialog:default-namespace
+;;
+;;  For a given commodity symbol, return a default namespace.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(define (qif-dialog:default-namespace s)
+  (if (string? s)
+      (let ((l (string-length s))
+            (d (string-index s #\.)))
+        (cond
+          ;; Guess NYSE for symbols of 1-3 characters.
+          ((< l 4)
+           GNC_COMMODITY_NS_NYSE)
+
+          ;; Guess NYSE for symbols of 1-3 characters
+          ;; followed by a dot and 1-2 characters.
+          ((and d
+                (< l 7)
+                (< 0 d 4)
+                (<= 2 (- l d) 3))
+           GNC_COMMODITY_NS_NYSE)
+
+          ;; Guess NASDAQ for symbols of 4 characters.
+          ((= l 4)
+           GNC_COMMODITY_NS_NASDAQ)
+
+          ;; Otherwise it's probably a fund.
+          (else
+           GNC_COMMODITY_NS_MUTUAL)))
+      GNC_COMMODITY_NS_MUTUAL))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;  qif-import:update-stock-hash
 ;;
 ;;  make new commodities for each new stock in acct-hash that isn't
@@ -623,15 +655,21 @@
                    
                    ;; we know nothing about this security.. we need to 
                    ;; ask about it
-                   (let ((ticker-symbol (qif-ticker-map:lookup-ticker ticker-map stock-name)))
+                   (let ((ticker-symbol
+                          (qif-ticker-map:lookup-ticker ticker-map
+                                                        stock-name))
+                         (namespace GNC_COMMODITY_NS_MUTUAL))
+
                      (if (not ticker-symbol)
-			 (set! ticker-symbol stock-name))
+			 (set! ticker-symbol stock-name)
+                         (set! namespace
+                           (qif-dialog:default-namespace ticker-symbol)))
                      (set! names (cons stock-name names))
                      (hash-set! 
                       stock-hash stock-name 
                       (gnc-commodity-new book
 					    stock-name
-                                            GNC_COMMODITY_NS_NYSE
+                                            namespace
                                             ticker-symbol
                                             ""
                                             100000))))))
