Ejemplo n.º 1
0
        public override void OnStrategyStart()
        {
            base.OnStrategyStart();

            // 测试用,自定义交易时间,仿真或实盘时可删除
            base.TimeHelper = new TimeHelper(new int[] { 0, 2400 }, 2100, 1458);

            base.TargetPosition = 0;
            base.DualPosition.Long.Qty = 0;
            base.DualPosition.Short.Qty = 0;

            bars86400 = GetBars(BarType.Time, 86400);

            smd30 = new SMD(bars86400, 30);
            lbd = new LookBackDays(smd30, lookBackDays, floorAmt, ceilingAmt);
            dbbu = new DynamicBBU(lbd, bars86400, bolBandTrig, BarData.Close);

            Draw(smd30, 2);
            Draw(lbd, 3);
            Draw(dbbu.SMA, 0);
            Draw(dbbu.BBL, 0);
            Draw(dbbu, 0);

            upBandSeries = new TimeSeries("upBandSeries");
            dnBandSeries = new TimeSeries("dnBandSeries");
            buyPointSeries = new TimeSeries("buyPointSeries");
            sellPointSeries = new TimeSeries("sellPointSeries");

            upBandSeries.Color = Color.Red;
            dnBandSeries.Color = Color.Red;

            Draw(upBandSeries, 0);
            Draw(dnBandSeries, 0);
            Draw(buyPointSeries, 0);
            Draw(sellPointSeries, 0);

            base.OnStrategyStart();
        }
        public override void OnStrategyStart()
        {
            bars86400 = GetBars(BarType.Time, 86400);

            smd30 = new SMD(bars86400, 30);
            lbd = new LookBackDays(smd30, lookBackDays, floorAmt, ceilingAmt);
            dbbu = new DynamicBBU(lbd, bars86400, bolBandTrig, BarData.Close);

            Draw(smd30, 2);
            Draw(lbd, 3);
            Draw(dbbu.SMA, 0);
            Draw(dbbu.BBL, 0);
            Draw(dbbu, 0);

            upBandSeries = new TimeSeries("upBandSeries");
            dnBandSeries = new TimeSeries("dnBandSeries");
            buyPointSeries = new TimeSeries("buyPointSeries");
            sellPointSeries = new TimeSeries("sellPointSeries");

            upBandSeries.Color = Color.Red;
            dnBandSeries.Color = Color.Red;

            Draw(upBandSeries, 0);
            Draw(dnBandSeries, 0);
            Draw(buyPointSeries, 0);
            Draw(sellPointSeries, 0);
        }