Exemplo n.º 1
0
        public StockRealTimeData queryRealTimeData(string stockID)
        {
            String            str = StockDataCollector.queryMarketRealTimeDataSina(stockID);
            StockRealTimeData rd  = StockDataConvertor.parseRealTimeData(str);

            if (rd != null)
            {
                rd.stockCode = StockIDUtil.getPureCode(stockID);
            }
            return(rd);
        }
Exemplo n.º 2
0
        public string getStockIndustry(string stockCode)
        {
            string industryName = null;
            string code         = StockIDUtil.getPureCode(stockCode);

            if (m_stockIndustryMap.TryGetValue(code, out industryName))
            {
                return(industryName);
            }

            return(null);
        }
Exemplo n.º 3
0
        public StockHolderData getStockHolderData(string stockID, string year, string season)
        {
            string        table = "stock_stockholder_" + year + "q" + season;
            string        code  = StockIDUtil.getPureCode(stockID);
            string        sql   = "select * from " + table + " where code='" + code + "'";
            List <string> rs    = MySqlDBReader.querySql(sql);

            if (rs != null && rs.Count > 0)
            {
                return(TushareDataConvertor.parseStockHolderData(rs));
            }
            return(null);
        }
Exemplo n.º 4
0
        private void button_add_ok_Click(object sender, EventArgs e)
        {
            string code = textBox_addstock_name.Text;

            if (!StockIDUtil.isValidCode(code))
            {
                if (!StockIDUtil.isValidPureCode(code))
                {
                    MessageBox.Show("无效的股票代码!");
                    this.Close();
                    return;
                }

                code = StockIDUtil.complementCode(code);
            }

            AppStockUtil.addItem(AppGlobalCache.getInstance().getTargetList(), code);
            this.Close();
        }
Exemplo n.º 5
0
        private void loadIndustry()
        {
            List <List <string> > info = CSVFileUtil.readCSV("Data/StockIndustry.txt", '\t');

            for (int i = 0; i < info.Count; i++)
            {
                List <string> arr = info[i];
                if (arr.Count < 3)
                {
                    continue;
                }
                m_stockIndustryMap.Add(arr[0], arr[2]);

                if (!m_stocksInIndustry.ContainsKey(arr[2]))
                {
                    List <string> stockList = new List <string>();
                    m_stocksInIndustry.Add(arr[2], stockList);
                }
                string stockID = StockIDUtil.complementCode(arr[0]);
                m_stocksInIndustry[arr[2]].Add(stockID);
            }
        }