示例#1
0
        protected override void OnStateChange()
        {
            if (State == State.SetDefaults)
            {
                Description = NinjaTrader.Custom.Resource.NinjaScriptIndicatorDescriptionChaikinVolatility;
                Name        = NinjaTrader.Custom.Resource.NinjaScriptIndicatorNameChaikinVolatility;
                IsSuspendedWhileInactive = true;
                MAPeriod  = 10;
                ROCPeriod = 10;

                AddPlot(Brushes.Crimson, NinjaTrader.Custom.Resource.NinjaScriptIndicatorNameChaikinVolatility);
            }
            else if (State == State.DataLoaded)
            {
                ema = EMA(Range(), MAPeriod);
            }
        }
示例#2
0
        protected override void OnStateChange()
        {
            if (State == State.SetDefaults)
            {
                Description = NinjaTrader.Custom.Resource.NinjaScriptIndicatorDescriptionROC;
                Name        = "GIRocHedger";
                IsSuspendedWhileInactive = true;
                Period = 8;

                AddLine(Brushes.DarkGray, 0, NinjaTrader.Custom.Resource.NinjaScriptIndicatorZeroLine);
                AddPlot(Brushes.Red, NinjaTrader.Custom.Resource.NinjaScriptIndicatorNameROC);
            }
            else if (State == State.DataLoaded)
            {
                baseEMA = EMA(Period);
            }
        }
示例#3
0
文件: DEMA.cs 项目: phixlr/Indicators
        protected override void OnStateChange()
        {
            if (State == State.SetDefaults)
            {
                Description = NinjaTrader.Custom.Resource.NinjaScriptIndicatorDescriptionDEMA;
                Name        = NinjaTrader.Custom.Resource.NinjaScriptIndicatorNameDEMA;
                IsSuspendedWhileInactive = true;
                IsOverlay = true;
                Period    = 14;

                AddPlot(Brushes.Goldenrod, NinjaTrader.Custom.Resource.NinjaScriptIndicatorNameDEMA);
            }
            else if (State == State.DataLoaded)
            {
                ema    = EMA(Inputs[0], Period);
                emaEma = EMA(ema, Period);
            }
        }
示例#4
0
        protected override void OnStateChange()
        {
            if (State == State.SetDefaults)
            {
                Description = NinjaTrader.Custom.Resource.NinjaScriptIndicatorDescriptionTRIX;
                Name        = NinjaTrader.Custom.Resource.NinjaScriptIndicatorNameTRIX;
                IsSuspendedWhileInactive = true;
                Period       = 14;
                SignalPeriod = 3;

                AddPlot(Brushes.DimGray, NinjaTrader.Custom.Resource.NinjaScriptIndicatorDefault);
                AddPlot(Brushes.Crimson, NinjaTrader.Custom.Resource.TRIXSignal);
                AddLine(Brushes.DarkGray, 0, NinjaTrader.Custom.Resource.NinjaScriptIndicatorZeroLine);
            }
            else if (State == State.DataLoaded)
            {
                emaTriple  = EMA(EMA(EMA(Inputs[0], Period), Period), Period);
                emaDefault = EMA(Default, SignalPeriod);
            }
        }
示例#5
0
文件: PPO.cs 项目: pppmbs/NT8Strategy
        protected override void OnStateChange()
        {
            if (State == State.SetDefaults)
            {
                Description = NinjaTrader.Custom.Resource.NinjaScriptIndicatorDescriptionPPO;
                Name        = NinjaTrader.Custom.Resource.NinjaScriptIndicatorNamePPO;
                IsSuspendedWhileInactive = true;
                Fast   = 12;
                Slow   = 26;
                Smooth = 9;

                AddPlot(Brushes.DimGray, NinjaTrader.Custom.Resource.NinjaScriptIndicatorDefault);
                AddPlot(Brushes.Crimson, NinjaTrader.Custom.Resource.PPOSmoothed);
                AddLine(Brushes.DarkGray, 0, NinjaTrader.Custom.Resource.NinjaScriptIndicatorZeroLine);
            }
            else if (State == State.DataLoaded)
            {
                emaFast = EMA(Fast);
                emaSlow = EMA(Slow);
            }
        }
示例#6
0
文件: APZ.cs 项目: phixlr/Indicators
        protected override void OnStateChange()
        {
            if (State == State.SetDefaults)
            {
                Description = NinjaTrader.Custom.Resource.NinjaScriptIndicatorDescriptionAPZ;
                Name        = NinjaTrader.Custom.Resource.NinjaScriptIndicatorNameAPZ;
                IsSuspendedWhileInactive = true;
                IsOverlay = true;
                BandPct   = 2;
                Period    = 20;

                AddPlot(Brushes.Crimson, NinjaTrader.Custom.Resource.NinjaScriptIndicatorLower);
                AddPlot(Brushes.Crimson, NinjaTrader.Custom.Resource.NinjaScriptIndicatorUpper);
            }
            else if (State == State.DataLoaded)
            {
                emaEMA    = EMA(EMA(newPeriod), newPeriod);
                emaRange  = EMA(Range(), Period);
                newPeriod = 0;
            }
        }
示例#7
0
        protected override void OnStateChange()
        {
            if (State == State.SetDefaults)
            {
                Description = NinjaTrader.Custom.Resource.NinjaScriptIndicatorDescriptionPFE;
                Name        = NinjaTrader.Custom.Resource.NinjaScriptIndicatorNamePFE;
                IsSuspendedWhileInactive = true;
                Period = 14;
                Smooth = 10;

                AddPlot(Brushes.DodgerBlue, NinjaTrader.Custom.Resource.NinjaScriptIndicatorNamePFE);
                AddLine(Brushes.DarkGray, 0, NinjaTrader.Custom.Resource.PFEZero);
            }

            else if (State == State.DataLoaded)
            {
                div             = new Series <double>(this);
                pfeSeries       = new Series <double>(this);
                singlePfeSeries = new Series <double>(this);
                ema             = EMA(pfeSeries, Smooth);
            }
        }
示例#8
0
        protected override void OnStateChange()
        {
            if (State == State.SetDefaults)
            {
                Description = NinjaTrader.Custom.Resource.NinjaScriptIndicatorDescriptionPriceOscillator;
                Name        = NinjaTrader.Custom.Resource.NinjaScriptIndicatorNamePriceOscillator;
                Fast        = 12;
                IsSuspendedWhileInactive = true;
                Slow   = 26;
                Smooth = 9;

                AddLine(Brushes.DarkGray, 0, NinjaTrader.Custom.Resource.NinjaScriptIndicatorZeroLine);
                AddPlot(Brushes.Goldenrod, NinjaTrader.Custom.Resource.NinjaScriptIndicatorNamePriceOscillator);
            }
            else if (State == State.DataLoaded)
            {
                smoothEma = new Series <double>(this);
                emaFast   = EMA(Fast);
                emaSlow   = EMA(Slow);
                emaSmooth = EMA(smoothEma, Smooth);
            }
        }
示例#9
0
文件: RIND.cs 项目: phixlr/Indicators
        protected override void OnStateChange()
        {
            if (State == State.SetDefaults)
            {
                Description = NinjaTrader.Custom.Resource.NinjaScriptIndicatorDescriptionRIND;
                Name        = NinjaTrader.Custom.Resource.NinjaScriptIndicatorNameRIND;
                IsOverlay   = false;
                IsSuspendedWhileInactive = true;
                PeriodQ = 3;
                Smooth  = 10;

                AddPlot(Brushes.DarkCyan, NinjaTrader.Custom.Resource.NinjaScriptIndicatorNameRIND);
            }

            else if (State == State.DataLoaded)
            {
                stochRange = new Series <double>(this);
                val1       = new Series <double>(this);
                ema        = EMA(stochRange, Smooth);
                min        = MIN(val1, PeriodQ);
                max        = MAX(val1, PeriodQ);
            }
        }