コード例 #1
0
        protected override void OnStart()
        {
            hmafast      = Indicators.GetIndicator <HMAfast>(5);
            hmaslow      = Indicators.GetIndicator <HMAslow>(31);
            _macd        = Indicators.MacdHistogram(LongCycle, ShortCycle, Period);
            HmaDaySeries = MarketData.GetSeries(TimeFrame.Hour4);
            hmaSignal    = Indicators.GetIndicator <HMASignals>(HmaDaySeries, 21, false, false, 3, false, 24);

            var dailySeries = MarketData.GetSeries(TimeFrame.Daily);

            atr = Indicators.AverageTrueRange(dailySeries, 20, MovingAverageType.Simple);

            Positions.Opened += PositionsOnOpened;
            Positions.Closed += PositionsOnClosed;
        }
コード例 #2
0
        protected override void OnStart()
        {
            cBotLabel         = "La Tortuga V3 Slow" + Symbol.Code + " " + TimeFrame.ToString();
            hmafast           = Indicators.GetIndicator <HMAfast>(FastPeriods);
            hmaslow           = Indicators.GetIndicator <HMAslow>(SlowPeriods);
            HmaDaySeries      = MarketData.GetSeries(TimeFrame.Hour);
            hmaSignal         = Indicators.GetIndicator <HMASignals>(HmaDaySeries, 21, false, false, 3, false, 24);
            Positions.Opened += PositionsOnOpened;
            Positions.Closed += PositionsOnClosed;
            // Start Time is the same day at 07:00:00 Server Time
            _startTime = Server.Time.Date.AddHours(StartTime);

            // Stop Time is the same day at 20:00:00
            _stopTime = Server.Time.Date.AddHours(StopTime);

            Print("Start Time {0},", _startTime);
            Print("Stop Time {0},", _stopTime);
        }