/// <summary>
        /// Gom Delta Volume
        /// </summary>
        /// <returns></returns>
        public GomDeltaVolume GomDeltaVolume(Data.IDataSeries input)
        {
            if (cacheGomDeltaVolume != null)
            {
                for (int idx = 0; idx < cacheGomDeltaVolume.Length; idx++)
                {
                    if (cacheGomDeltaVolume[idx].EqualsInput(input))
                    {
                        return(cacheGomDeltaVolume[idx]);
                    }
                }
            }

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

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

                GomDeltaVolume[] tmp = new GomDeltaVolume[cacheGomDeltaVolume == null ? 1 : cacheGomDeltaVolume.Length + 1];
                if (cacheGomDeltaVolume != null)
                {
                    cacheGomDeltaVolume.CopyTo(tmp, 0);
                }
                tmp[tmp.Length - 1] = indicator;
                cacheGomDeltaVolume = tmp;
                return(indicator);
            }
        }
示例#2
0
        /// <summary>
        /// Gom Delta Volume
        /// </summary>
        /// <returns></returns>
        public GomDeltaVolume GomDeltaVolume(Data.IDataSeries input)
        {
            if (cacheGomDeltaVolume != null)
                for (int idx = 0; idx < cacheGomDeltaVolume.Length; idx++)
                    if (cacheGomDeltaVolume[idx].EqualsInput(input))
                        return cacheGomDeltaVolume[idx];

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

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

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