示例#1
0
        /// <summary>
        /// gets a basket from a file
        /// </summary>
        /// <returns></returns>
        public Basket FetchFILE()
        {
            Basket mb = new BasketImpl();

            if ((_file == "") || (_file == null))
            {
                return(mb);
            }
            System.IO.StreamReader sr = null;
            try
            {
                sr = new System.IO.StreamReader(_file);
            }
            catch (Exception) { return(mb); }
            string file = sr.ReadToEnd();

            if (_nyse && _linkedonly)
            {
                mb.Add(ParseStocks.LinkedOnlyNYSE(file));
            }
            else if (_nyse)
            {
                mb.Add(ParseStocks.NYSE(file));
            }
            if (_nasd && _linkedonly)
            {
                mb.Add(ParseStocks.LinkedOnlyNASDAQ(file));
            }
            else if (_nasd)
            {
                mb.Add(ParseStocks.NASDAQ(file));
            }
            if (_xdupe)
            {
                mb = Fetch.RemoveDupe(mb);
            }
            return(mb);
        }
示例#2
0
        /// <summary>
        /// gets any linked approximate nasdaq symbols from a url (approximate = unverified, any 1-3 all caps symbol)
        /// </summary>
        /// <param name="url"></param>
        /// <returns></returns>
        public static Basket LinkedNASDAQFromURL(string url)
        {
            WebClient wc = new WebClient();

            return(ParseStocks.LinkedOnlyNASDAQ(wc.DownloadString(url)));
        }
示例#3
0
        /// <summary>
        /// gets approximate nyse symbols from a url
        /// </summary>
        /// <param name="url"></param>
        /// <returns></returns>
        public static Basket NYSEFromURL(string url)
        {
            WebClient wc = new WebClient();

            return(ParseStocks.NYSE(wc.DownloadString(url)));
        }