/// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public HomodyneDiscriminator HomodyneDiscriminator(Data.IDataSeries input)
        {
            if (cacheHomodyneDiscriminator != null)
                for (int idx = 0; idx < cacheHomodyneDiscriminator.Length; idx++)
                    if (cacheHomodyneDiscriminator[idx].EqualsInput(input))
                        return cacheHomodyneDiscriminator[idx];

            lock (checkHomodyneDiscriminator)
            {
                if (cacheHomodyneDiscriminator != null)
                    for (int idx = 0; idx < cacheHomodyneDiscriminator.Length; idx++)
                        if (cacheHomodyneDiscriminator[idx].EqualsInput(input))
                            return cacheHomodyneDiscriminator[idx];

                HomodyneDiscriminator indicator = new HomodyneDiscriminator();
                indicator.BarsRequired = BarsRequired;
                indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
                indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
                indicator.MaximumBarsLookBack = MaximumBarsLookBack;
#endif
                indicator.Input = input;
                Indicators.Add(indicator);
                indicator.SetUp();

                HomodyneDiscriminator[] tmp = new HomodyneDiscriminator[cacheHomodyneDiscriminator == null ? 1 : cacheHomodyneDiscriminator.Length + 1];
                if (cacheHomodyneDiscriminator != null)
                    cacheHomodyneDiscriminator.CopyTo(tmp, 0);
                tmp[tmp.Length - 1] = indicator;
                cacheHomodyneDiscriminator = tmp;
                return indicator;
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public HomodyneDiscriminator HomodyneDiscriminator(Data.IDataSeries input)
        {
            if (cacheHomodyneDiscriminator != null)
            {
                for (int idx = 0; idx < cacheHomodyneDiscriminator.Length; idx++)
                {
                    if (cacheHomodyneDiscriminator[idx].EqualsInput(input))
                    {
                        return(cacheHomodyneDiscriminator[idx]);
                    }
                }
            }

            lock (checkHomodyneDiscriminator)
            {
                if (cacheHomodyneDiscriminator != null)
                {
                    for (int idx = 0; idx < cacheHomodyneDiscriminator.Length; idx++)
                    {
                        if (cacheHomodyneDiscriminator[idx].EqualsInput(input))
                        {
                            return(cacheHomodyneDiscriminator[idx]);
                        }
                    }
                }

                HomodyneDiscriminator indicator = new HomodyneDiscriminator();
                indicator.BarsRequired        = BarsRequired;
                indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
                indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
                indicator.MaximumBarsLookBack         = MaximumBarsLookBack;
#endif
                indicator.Input = input;
                Indicators.Add(indicator);
                indicator.SetUp();

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