Esempio n. 1
0
        public void TestHistoryDataForward_TickKLine()
        {
            //主做螺纹钢,跟踪螺纹钢指数15分钟线和日线
            //跟踪郑醇的分钟线
            string[] codes = new string[] { "RB1801", "RB0000", "MA801" };
            int      start = 20170601;
            int      end   = 20170603;

            ForwardReferedPeriods[] referedPeriods = new ForwardReferedPeriods[3];
            referedPeriods[0] = new ForwardReferedPeriods(new KLinePeriod[] { KLinePeriod.KLinePeriod_1Minute, KLinePeriod.KLinePeriod_15Minute, KLinePeriod.KLinePeriod_1Day }, true, true);
            referedPeriods[1] = new ForwardReferedPeriods(new KLinePeriod[] { KLinePeriod.KLinePeriod_15Minute, KLinePeriod.KLinePeriod_1Day }, true, true);
            referedPeriods[2] = new ForwardReferedPeriods(new KLinePeriod[] { KLinePeriod.KLinePeriod_1Minute }, true, true);
            ForwardPeriod forwardPeriod = new ForwardPeriod(true, KLinePeriod.KLinePeriod_1Minute);
            IDataForward  forward       = DataCenter.Default.HistoryDataForwardFactory.CreateHistoryDataForward(codes, start, end, referedPeriods, forwardPeriod);

            forward.OnBar  += Forward_OnBar2;
            forward.OnTick += Forward_OnTick2;

            while (forward.Forward())
            {
            }
        }
 public bool Forward()
 {
     return(historyDataForward.Forward());
 }