Exemple #1
0
        public int GetRecentOpenDate(string code, double time)
        {
            OpenDateCalculator dayStartTime = GetOrCreateDayStartTime(code);

            if (dayStartTime == null)
            {
                return((int)time);
            }
            return(dayStartTime.GetRecentOpenDate(time));
        }
Exemple #2
0
        public TradingSession GetOpenTime(string code, int date)
        {
            OpenDateCalculator dayStartTime = GetOrCreateDayStartTime(code);

            if (dayStartTime == null)
            {
                return(null);
            }
            return(dayStartTime.GetOpenTime(date));
        }
Exemple #3
0
        private OpenDateCalculator GetOrCreateDayStartTime(string code)
        {
            OpenDateCalculator dayStartTime;

            if (!dic.ContainsKey(code))
            {
                dayStartTime = OpenDateCalculator.CreateDayStartTime(GetDayOpenTimePath(code));
                if (dayStartTime == null)
                {
                    return(null);
                }
                dic.Add(code, dayStartTime);
            }
            else
            {
                dayStartTime = dic[code];
            }
            return(dayStartTime);
        }