Example #1
0
 public DataForForward_Code(IDataPackage_Code dataPackage, ForwardReferedPeriods referedPeriods)
 {
     this.dataPackage          = dataPackage;
     this.referedPeriods       = referedPeriods;
     this.dic_Period_KLineData = dataPackage.CreateKLineData_RealTimes(referedPeriods.UsedKLinePeriods);
     this.mainKLinePeriod      = referedPeriods.GetMinPeriod();
     this.mainKLineData        = this.dic_Period_KLineData[mainKLinePeriod];
     this.cache_TradingDay     = new CacheUtils_TradingDay(dataPackage.GetTradingDays());
 }
Example #2
0
        public void Load(XmlElement xmlElem)
        {
            this.dataPackage    = this.dataCenter.DataPackageFactory.CreateDataPackage_Code(xmlElem);
            this.referedPeriods = new ForwardReferedPeriods();
            this.referedPeriods.Load(xmlElem);

            this.dic_Period_KLineData = dataPackage.CreateKLineData_RealTimes(referedPeriods.UsedKLinePeriods);
            this.cache_TradingDay     = new CacheUtils_TradingDay(dataPackage.GetTradingDays());
            this.TradingDay           = int.Parse(xmlElem.GetAttribute("tradingDay"));
        }
        public HistoryDataForward_Code_TickPeriod(IDataPackage_Code dataPackage, IList <KLinePeriod> periods, KLinePeriod forwardPeriod, bool useTimeLineData)
        {
            this.allKLinePeriods = periods;
            Dictionary <KLinePeriod, IKLineData_RealTime> allKLineData = dataPackage.CreateKLineData_RealTimes(periods);
            IList <int> tradingDays = dataPackage.GetTradingDays();

            this.useTimeLineData = useTimeLineData;
            this.onBarArgument   = new ForwardOnBarArgument(barFinishedInfos);
            Init(dataPackage, allKLineData, tradingDays, forwardPeriod);
        }