Esempio n. 1
0
 public IDataNavigate_Code CreateDataNavigate_Code(string code, double time)
 {
     int openDate = this.dataReader.CreateTradingTimeReader(code).GetRecentTradingDay(time);
     if (openDate < 0)
         return null;
     IDataPackage_Code dataPackage = DataPackageFactory.CreateDataPackage(dataReader, code, openDate, 500, 500);
     return CreateDataNavigate_Code(dataPackage, time);
 }
Esempio n. 2
0
        public HistoryDataForward_Code(IDataReader dataReader, string code, HistoryDataForwardArguments args)
        {
            IDataPackage_Code     dataPackage    = DataPackageFactory.CreateDataPackage(dataReader, code, args.StartDate, args.EndDate);
            ForwardReferedPeriods referedPeriods = args.ReferedPeriods;
            ForwardPeriod         forwardPeriod  = new ForwardPeriod(args.IsTickForward, args.ForwardKLinePeriod);

            this.Init(dataPackage, referedPeriods, forwardPeriod);
        }
Esempio n. 3
0
        public DataNavigate_Code2(IDataReader dataReader, string code, double time)
        {
            int openDate = dataReader.CreateTradingTimeReader(code).GetRecentTradingDay(time);
            ITradingDayReader tradingDayReader = dataReader.TradingDayReader;

            int index = dataReader.TradingDayReader.GetTradingDayIndex(openDate);
            //默认取前100天,后50天数据
            int startIndex = index - 100;

            startIndex = startIndex < 0 ? 0 : startIndex;
            int startDate = tradingDayReader.GetTradingDay(startIndex);

            int endIndex = index + 50;

            if (endIndex >= tradingDayReader.GetAllTradingDays().Count)
            {
                endIndex = tradingDayReader.GetAllTradingDays().Count - 1;
            }
            int endDate = tradingDayReader.GetTradingDay(endIndex);

            this.dataPackage = DataPackageFactory.CreateDataPackage(dataReader, code, startDate, endDate);
            this.NavigateTo(time);
        }
Esempio n. 4
0
 public IDataNavigate_Code CreateDataNavigate_Code(string code, double time, int beforeDays, int afterDays)
 {
     int openDate = this.dataReader.CreateTradingTimeReader(code).GetRecentTradingDay(time);
     IDataPackage_Code dataPackage = DataPackageFactory.CreateDataPackage(dataReader, code, openDate, beforeDays, afterDays);
     return CreateDataNavigate_Code(dataPackage, time);
 }