Exemple #1
0
        /// <summary>
        /// Adaptive CCI
        /// </summary>
        /// <returns></returns>
        public Indicator.AdaptiveCci AdaptiveCci(Data.IDataSeries input, AdaptiveCciPlots adaptiveCciPlotNo, int altNumbarsPlot1, int altNumbarsPlot2, int altNumbarsPlot3, int altNumbarsPlot4, double cycPart, int periodMultiplier, int smooth)
        {
            if (InInitialize && input == null)
            {
                throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method");
            }

            return(_indicator.AdaptiveCci(input, adaptiveCciPlotNo, altNumbarsPlot1, altNumbarsPlot2, altNumbarsPlot3, altNumbarsPlot4, cycPart, periodMultiplier, smooth));
        }
        /// <summary>
        /// Adaptive CCI
        /// </summary>
        /// <returns></returns>
        public Indicator.AdaptiveCci AdaptiveCci(Data.IDataSeries input, AdaptiveCciPlots adaptiveCciPlotNo, int altNumbarsPlot1, int altNumbarsPlot2, int altNumbarsPlot3, int altNumbarsPlot4, double cycPart, int periodMultiplier, int smooth)
        {
            if (InInitialize && input == null)
                throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method");

            return _indicator.AdaptiveCci(input, adaptiveCciPlotNo, altNumbarsPlot1, altNumbarsPlot2, altNumbarsPlot3, altNumbarsPlot4, cycPart, periodMultiplier, smooth);
        }
 public Indicator.AdaptiveCci AdaptiveCci(AdaptiveCciPlots adaptiveCciPlotNo, int altNumbarsPlot1, int altNumbarsPlot2, int altNumbarsPlot3, int altNumbarsPlot4, double cycPart, int periodMultiplier, int smooth)
 {
     return _indicator.AdaptiveCci(Input, adaptiveCciPlotNo, altNumbarsPlot1, altNumbarsPlot2, altNumbarsPlot3, altNumbarsPlot4, cycPart, periodMultiplier, smooth);
 }
        /// <summary>
        /// Adaptive CCI
        /// </summary>
        /// <returns></returns>
        public AdaptiveCci AdaptiveCci(Data.IDataSeries input, AdaptiveCciPlots adaptiveCciPlotNo, int altNumbarsPlot1, int altNumbarsPlot2, int altNumbarsPlot3, int altNumbarsPlot4, double cycPart, int periodMultiplier, int smooth)
        {
            if (cacheAdaptiveCci != null)
                for (int idx = 0; idx < cacheAdaptiveCci.Length; idx++)
                    if (cacheAdaptiveCci[idx].AdaptiveCciPlotNo == adaptiveCciPlotNo && cacheAdaptiveCci[idx].AltNumbarsPlot1 == altNumbarsPlot1 && cacheAdaptiveCci[idx].AltNumbarsPlot2 == altNumbarsPlot2 && cacheAdaptiveCci[idx].AltNumbarsPlot3 == altNumbarsPlot3 && cacheAdaptiveCci[idx].AltNumbarsPlot4 == altNumbarsPlot4 && Math.Abs(cacheAdaptiveCci[idx].CycPart - cycPart) <= double.Epsilon && cacheAdaptiveCci[idx].PeriodMultiplier == periodMultiplier && cacheAdaptiveCci[idx].Smooth == smooth && cacheAdaptiveCci[idx].EqualsInput(input))
                        return cacheAdaptiveCci[idx];

            lock (checkAdaptiveCci)
            {
                checkAdaptiveCci.AdaptiveCciPlotNo = adaptiveCciPlotNo;
                adaptiveCciPlotNo = checkAdaptiveCci.AdaptiveCciPlotNo;
                checkAdaptiveCci.AltNumbarsPlot1 = altNumbarsPlot1;
                altNumbarsPlot1 = checkAdaptiveCci.AltNumbarsPlot1;
                checkAdaptiveCci.AltNumbarsPlot2 = altNumbarsPlot2;
                altNumbarsPlot2 = checkAdaptiveCci.AltNumbarsPlot2;
                checkAdaptiveCci.AltNumbarsPlot3 = altNumbarsPlot3;
                altNumbarsPlot3 = checkAdaptiveCci.AltNumbarsPlot3;
                checkAdaptiveCci.AltNumbarsPlot4 = altNumbarsPlot4;
                altNumbarsPlot4 = checkAdaptiveCci.AltNumbarsPlot4;
                checkAdaptiveCci.CycPart = cycPart;
                cycPart = checkAdaptiveCci.CycPart;
                checkAdaptiveCci.PeriodMultiplier = periodMultiplier;
                periodMultiplier = checkAdaptiveCci.PeriodMultiplier;
                checkAdaptiveCci.Smooth = smooth;
                smooth = checkAdaptiveCci.Smooth;

                if (cacheAdaptiveCci != null)
                    for (int idx = 0; idx < cacheAdaptiveCci.Length; idx++)
                        if (cacheAdaptiveCci[idx].AdaptiveCciPlotNo == adaptiveCciPlotNo && cacheAdaptiveCci[idx].AltNumbarsPlot1 == altNumbarsPlot1 && cacheAdaptiveCci[idx].AltNumbarsPlot2 == altNumbarsPlot2 && cacheAdaptiveCci[idx].AltNumbarsPlot3 == altNumbarsPlot3 && cacheAdaptiveCci[idx].AltNumbarsPlot4 == altNumbarsPlot4 && Math.Abs(cacheAdaptiveCci[idx].CycPart - cycPart) <= double.Epsilon && cacheAdaptiveCci[idx].PeriodMultiplier == periodMultiplier && cacheAdaptiveCci[idx].Smooth == smooth && cacheAdaptiveCci[idx].EqualsInput(input))
                            return cacheAdaptiveCci[idx];

                AdaptiveCci indicator = new AdaptiveCci();
                indicator.BarsRequired = BarsRequired;
                indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
                indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
                indicator.MaximumBarsLookBack = MaximumBarsLookBack;
#endif
                indicator.Input = input;
                indicator.AdaptiveCciPlotNo = adaptiveCciPlotNo;
                indicator.AltNumbarsPlot1 = altNumbarsPlot1;
                indicator.AltNumbarsPlot2 = altNumbarsPlot2;
                indicator.AltNumbarsPlot3 = altNumbarsPlot3;
                indicator.AltNumbarsPlot4 = altNumbarsPlot4;
                indicator.CycPart = cycPart;
                indicator.PeriodMultiplier = periodMultiplier;
                indicator.Smooth = smooth;
                Indicators.Add(indicator);
                indicator.SetUp();

                AdaptiveCci[] tmp = new AdaptiveCci[cacheAdaptiveCci == null ? 1 : cacheAdaptiveCci.Length + 1];
                if (cacheAdaptiveCci != null)
                    cacheAdaptiveCci.CopyTo(tmp, 0);
                tmp[tmp.Length - 1] = indicator;
                cacheAdaptiveCci = tmp;
                return indicator;
            }
        }
Exemple #5
0
 public Indicator.AdaptiveCci AdaptiveCci(AdaptiveCciPlots adaptiveCciPlotNo, int altNumbarsPlot1, int altNumbarsPlot2, int altNumbarsPlot3, int altNumbarsPlot4, double cycPart, int periodMultiplier, int smooth)
 {
     return(_indicator.AdaptiveCci(Input, adaptiveCciPlotNo, altNumbarsPlot1, altNumbarsPlot2, altNumbarsPlot3, altNumbarsPlot4, cycPart, periodMultiplier, smooth));
 }
Exemple #6
0
        /// <summary>
        /// Adaptive CCI
        /// </summary>
        /// <returns></returns>
        public AdaptiveCci AdaptiveCci(Data.IDataSeries input, AdaptiveCciPlots adaptiveCciPlotNo, int altNumbarsPlot1, int altNumbarsPlot2, int altNumbarsPlot3, int altNumbarsPlot4, double cycPart, int periodMultiplier, int smooth)
        {
            if (cacheAdaptiveCci != null)
            {
                for (int idx = 0; idx < cacheAdaptiveCci.Length; idx++)
                {
                    if (cacheAdaptiveCci[idx].AdaptiveCciPlotNo == adaptiveCciPlotNo && cacheAdaptiveCci[idx].AltNumbarsPlot1 == altNumbarsPlot1 && cacheAdaptiveCci[idx].AltNumbarsPlot2 == altNumbarsPlot2 && cacheAdaptiveCci[idx].AltNumbarsPlot3 == altNumbarsPlot3 && cacheAdaptiveCci[idx].AltNumbarsPlot4 == altNumbarsPlot4 && Math.Abs(cacheAdaptiveCci[idx].CycPart - cycPart) <= double.Epsilon && cacheAdaptiveCci[idx].PeriodMultiplier == periodMultiplier && cacheAdaptiveCci[idx].Smooth == smooth && cacheAdaptiveCci[idx].EqualsInput(input))
                    {
                        return(cacheAdaptiveCci[idx]);
                    }
                }
            }

            lock (checkAdaptiveCci)
            {
                checkAdaptiveCci.AdaptiveCciPlotNo = adaptiveCciPlotNo;
                adaptiveCciPlotNo = checkAdaptiveCci.AdaptiveCciPlotNo;
                checkAdaptiveCci.AltNumbarsPlot1 = altNumbarsPlot1;
                altNumbarsPlot1 = checkAdaptiveCci.AltNumbarsPlot1;
                checkAdaptiveCci.AltNumbarsPlot2 = altNumbarsPlot2;
                altNumbarsPlot2 = checkAdaptiveCci.AltNumbarsPlot2;
                checkAdaptiveCci.AltNumbarsPlot3 = altNumbarsPlot3;
                altNumbarsPlot3 = checkAdaptiveCci.AltNumbarsPlot3;
                checkAdaptiveCci.AltNumbarsPlot4 = altNumbarsPlot4;
                altNumbarsPlot4          = checkAdaptiveCci.AltNumbarsPlot4;
                checkAdaptiveCci.CycPart = cycPart;
                cycPart = checkAdaptiveCci.CycPart;
                checkAdaptiveCci.PeriodMultiplier = periodMultiplier;
                periodMultiplier        = checkAdaptiveCci.PeriodMultiplier;
                checkAdaptiveCci.Smooth = smooth;
                smooth = checkAdaptiveCci.Smooth;

                if (cacheAdaptiveCci != null)
                {
                    for (int idx = 0; idx < cacheAdaptiveCci.Length; idx++)
                    {
                        if (cacheAdaptiveCci[idx].AdaptiveCciPlotNo == adaptiveCciPlotNo && cacheAdaptiveCci[idx].AltNumbarsPlot1 == altNumbarsPlot1 && cacheAdaptiveCci[idx].AltNumbarsPlot2 == altNumbarsPlot2 && cacheAdaptiveCci[idx].AltNumbarsPlot3 == altNumbarsPlot3 && cacheAdaptiveCci[idx].AltNumbarsPlot4 == altNumbarsPlot4 && Math.Abs(cacheAdaptiveCci[idx].CycPart - cycPart) <= double.Epsilon && cacheAdaptiveCci[idx].PeriodMultiplier == periodMultiplier && cacheAdaptiveCci[idx].Smooth == smooth && cacheAdaptiveCci[idx].EqualsInput(input))
                        {
                            return(cacheAdaptiveCci[idx]);
                        }
                    }
                }

                AdaptiveCci indicator = new AdaptiveCci();
                indicator.BarsRequired        = BarsRequired;
                indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
                indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
                indicator.MaximumBarsLookBack         = MaximumBarsLookBack;
#endif
                indicator.Input             = input;
                indicator.AdaptiveCciPlotNo = adaptiveCciPlotNo;
                indicator.AltNumbarsPlot1   = altNumbarsPlot1;
                indicator.AltNumbarsPlot2   = altNumbarsPlot2;
                indicator.AltNumbarsPlot3   = altNumbarsPlot3;
                indicator.AltNumbarsPlot4   = altNumbarsPlot4;
                indicator.CycPart           = cycPart;
                indicator.PeriodMultiplier  = periodMultiplier;
                indicator.Smooth            = smooth;
                Indicators.Add(indicator);
                indicator.SetUp();

                AdaptiveCci[] tmp = new AdaptiveCci[cacheAdaptiveCci == null ? 1 : cacheAdaptiveCci.Length + 1];
                if (cacheAdaptiveCci != null)
                {
                    cacheAdaptiveCci.CopyTo(tmp, 0);
                }
                tmp[tmp.Length - 1] = indicator;
                cacheAdaptiveCci    = tmp;
                return(indicator);
            }
        }