Exemple #1
0
        /// <summary>提取标的交易所信息
        /// </summary>
        public static StockExchangeInfo Get_StockExchangeInfo(typeStockExchange stockExchange)
        {
            StockExchangeInfo pStockExchangeInfo = null;

            if (_stockExchangeInfos.TryGetValue(stockExchange, out pStockExchangeInfo))
            {
            }

            if (pStockExchangeInfo == null)
            {
                pStockExchangeInfo = new StockExchangeInfo(stockExchange);
                _stockExchangeInfos[stockExchange] = pStockExchangeInfo;
            }
            return(pStockExchangeInfo);
        }
Exemple #2
0
        /// <summary>初始标的交易所信息
        /// </summary>
        public bool Init_StockExchangeInfo(typeStockExchange stockExchange)
        {
            string strTag = stockExchange.ToString();
            string strSet = _configExchangeInfo.config[strTag + ":timeset"];

            _TimeSets = new zxcTimeSets(strSet, strTag);

            //H
            string strSet_Hours = _configExchangeInfo.config[strTag + ":timesets:hours"];

            string[] strTemps = strSet_Hours.Replace(" ", "").Split(",");
            _dictTimes_H = new List <double>();
            foreach (var item in strTemps)
            {
                double dHour = Convert.ToDouble(item);
                _dictTimes_H.Add(dHour);
            }

            //H2
            string strSet_Hours2 = _configExchangeInfo.config[strTag + ":timesets:hours2"];

            string[] strTemps2 = strSet_Hours2.Replace(" ", "").Split(",");
            _dictTimes_H2 = new List <double>();
            foreach (var item in strTemps2)
            {
                double dHour = Convert.ToDouble(item);
                _dictTimes_H2.Add(dHour);
            }

            //Day
            string strSet_Day = _configExchangeInfo.config[strTag + ":timesets:dayofweek"];

            string[] strTemps3 = strSet_Day.Replace(" ", "").Split(",");
            _dictTimes_Day = new List <double>();
            foreach (var item in strTemps3)
            {
                double dDay = Convert.ToDouble(item);
                _dictTimes_Day.Add(dDay);
            }
            _dayTimes_H = Convert.ToDouble(_configExchangeInfo.config[strTag + ":timesets:dayhour"]);
            return(true);
        }
Exemple #3
0
        /// <summary>初始标的信息
        /// </summary>
        public static StockInfo Init_StockInfo(string strLine)
        {
            string[] strTemps = strLine.Split(",");
            if (strTemps.Length < 5)
            {
                return(null);
            }

            string            strStockType   = strTemps[4] == "opt" ? "Option" : strTemps[4];
            typeStockExchange pStockExchange = (typeStockExchange)Enum.Parse(typeof(typeStockExchange), strTemps[0]);
            typeStock         pStockType     = (typeStock)Enum.Parse(typeof(typeStock), strStockType, true);
            StockInfo         pStockInfo     = new StockInfo()
            {
                StockExchange = pStockExchange,
                StockID       = strTemps[1],
                StockName     = strTemps[2],
                StockName_En  = strTemps[3],
                StockType     = pStockType
            };

            return(pStockInfo);
        }
Exemple #4
0
 public StockExchangeInfo(typeStockExchange stockExchange)
 {
     _StockExchange = stockExchange;
     this.Init_StockExchangeInfo(_StockExchange);
 }