Example #1
0
        public Quote getQoute(Symbol symbol)
        {
            //the pupose of this is to get an up to minute stock update without having to do a sql query with a where clause looking for the current time
            //first time will take a second to run after that it will speed up
            Quote StockQt = new Quote();
            Qt.StockQuote SQ = new Qt.StockQuote();
            XmlDocument doc = new XmlDocument();

            string UpdatedQoute = SQ.GetQuote(symbol.ToString());
            doc.LoadXml(UpdatedQoute);
            StockQt.price = Convert.ToDouble(doc.DocumentElement.SelectSingleNode("//Stock/Last").InnerText);
            StockQt.SymbolName = doc.DocumentElement.SelectSingleNode("//Stock/Name").InnerText;
            StockQt.timestamp = Convert.ToDateTime(doc.DocumentElement.SelectSingleNode("//Stock/Date").InnerText + " " + doc.DocumentElement.SelectSingleNode("//Stock/Time").InnerText);
            StockQt.Symbol = symbol;
            return StockQt;
        }
Example #2
0
        public Quote getQoute(Symbol symbol)
        {
            //the pupose of this is to get an up to minute stock update without having to do a sql query with a where clause looking for the current time
            //first time will take a second to run after that it will speed up
            Quote StockQt = new Quote();

            Qt.StockQuote SQ  = new Qt.StockQuote();
            XmlDocument   doc = new XmlDocument();

            string UpdatedQoute = SQ.GetQuote(symbol.ToString());

            doc.LoadXml(UpdatedQoute);
            StockQt.price      = Convert.ToDouble(doc.DocumentElement.SelectSingleNode("//Stock/Last").InnerText);
            StockQt.SymbolName = doc.DocumentElement.SelectSingleNode("//Stock/Name").InnerText;
            StockQt.timestamp  = Convert.ToDateTime(doc.DocumentElement.SelectSingleNode("//Stock/Date").InnerText + " " + doc.DocumentElement.SelectSingleNode("//Stock/Time").InnerText);
            StockQt.Symbol     = symbol;
            return(StockQt);
        }
Example #3
0
        public bool startWatching(string SymbolName)
        {
            StockQuote SQ = new StockQuote();
            XmlDocument Doc = new XmlDocument();
            string Check;
            XmlNode XmlCheck;

            string QouteUpdate = SQ.GetQuote(SymbolName);
            Doc.LoadXml(QouteUpdate);

            //Check the stock to see if it has ever had an opening price
            XmlCheck = Doc.DocumentElement.SelectSingleNode("//Stock/Open");
            Check = XmlCheck.InnerText;

            if (Check == "N/A")
            {
                return false;
            }
            else
            {
                return true;
            }
        }