예제 #1
0
        public MarketBasket FILE()
        {
            MarketBasket mb = new MarketBasket();

            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
        public static MarketBasket LinkedNASDAQFromURL(string url)
        {
            WebClient wc = new WebClient();

            return(ParseStocks.LinkedOnlyNASDAQ(wc.DownloadString(url)));
        }
예제 #3
0
        public static MarketBasket NYSEFromURL(string url)
        {
            WebClient wc = new WebClient();

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