Esempio n. 1
0
        /// <summary>
        /// ACD buy sell signal with 3 params, tickbuffer, OR time, and A time
        /// </summary>
        /// <returns></returns>
        public ZZACDwith3params ZZACDwith3params(Data.IDataSeries input, int numBarAsignal, int oRNumBars, int tickBuffer)
        {
            if (cacheZZACDwith3params != null)
            {
                for (int idx = 0; idx < cacheZZACDwith3params.Length; idx++)
                {
                    if (cacheZZACDwith3params[idx].NumBarAsignal == numBarAsignal && cacheZZACDwith3params[idx].ORNumBars == oRNumBars && cacheZZACDwith3params[idx].TickBuffer == tickBuffer && cacheZZACDwith3params[idx].EqualsInput(input))
                    {
                        return(cacheZZACDwith3params[idx]);
                    }
                }
            }

            lock (checkZZACDwith3params)
            {
                checkZZACDwith3params.NumBarAsignal = numBarAsignal;
                numBarAsignal = checkZZACDwith3params.NumBarAsignal;
                checkZZACDwith3params.ORNumBars = oRNumBars;
                oRNumBars = checkZZACDwith3params.ORNumBars;
                checkZZACDwith3params.TickBuffer = tickBuffer;
                tickBuffer = checkZZACDwith3params.TickBuffer;

                if (cacheZZACDwith3params != null)
                {
                    for (int idx = 0; idx < cacheZZACDwith3params.Length; idx++)
                    {
                        if (cacheZZACDwith3params[idx].NumBarAsignal == numBarAsignal && cacheZZACDwith3params[idx].ORNumBars == oRNumBars && cacheZZACDwith3params[idx].TickBuffer == tickBuffer && cacheZZACDwith3params[idx].EqualsInput(input))
                        {
                            return(cacheZZACDwith3params[idx]);
                        }
                    }
                }

                ZZACDwith3params indicator = new ZZACDwith3params();
                indicator.BarsRequired        = BarsRequired;
                indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
                indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
                indicator.MaximumBarsLookBack         = MaximumBarsLookBack;
#endif
                indicator.Input         = input;
                indicator.NumBarAsignal = numBarAsignal;
                indicator.ORNumBars     = oRNumBars;
                indicator.TickBuffer    = tickBuffer;
                Indicators.Add(indicator);
                indicator.SetUp();

                ZZACDwith3params[] tmp = new ZZACDwith3params[cacheZZACDwith3params == null ? 1 : cacheZZACDwith3params.Length + 1];
                if (cacheZZACDwith3params != null)
                {
                    cacheZZACDwith3params.CopyTo(tmp, 0);
                }
                tmp[tmp.Length - 1]   = indicator;
                cacheZZACDwith3params = tmp;
                return(indicator);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// ACD buy sell signal with 3 params, tickbuffer, OR time, and A time
        /// </summary>
        /// <returns></returns>
        public ZZACDwith3params ZZACDwith3params(Data.IDataSeries input, int numBarAsignal, int oRNumBars, int tickBuffer)
        {
            if (cacheZZACDwith3params != null)
                for (int idx = 0; idx < cacheZZACDwith3params.Length; idx++)
                    if (cacheZZACDwith3params[idx].NumBarAsignal == numBarAsignal && cacheZZACDwith3params[idx].ORNumBars == oRNumBars && cacheZZACDwith3params[idx].TickBuffer == tickBuffer && cacheZZACDwith3params[idx].EqualsInput(input))
                        return cacheZZACDwith3params[idx];

            lock (checkZZACDwith3params)
            {
                checkZZACDwith3params.NumBarAsignal = numBarAsignal;
                numBarAsignal = checkZZACDwith3params.NumBarAsignal;
                checkZZACDwith3params.ORNumBars = oRNumBars;
                oRNumBars = checkZZACDwith3params.ORNumBars;
                checkZZACDwith3params.TickBuffer = tickBuffer;
                tickBuffer = checkZZACDwith3params.TickBuffer;

                if (cacheZZACDwith3params != null)
                    for (int idx = 0; idx < cacheZZACDwith3params.Length; idx++)
                        if (cacheZZACDwith3params[idx].NumBarAsignal == numBarAsignal && cacheZZACDwith3params[idx].ORNumBars == oRNumBars && cacheZZACDwith3params[idx].TickBuffer == tickBuffer && cacheZZACDwith3params[idx].EqualsInput(input))
                            return cacheZZACDwith3params[idx];

                ZZACDwith3params indicator = new ZZACDwith3params();
                indicator.BarsRequired = BarsRequired;
                indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
                indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
                indicator.MaximumBarsLookBack = MaximumBarsLookBack;
#endif
                indicator.Input = input;
                indicator.NumBarAsignal = numBarAsignal;
                indicator.ORNumBars = oRNumBars;
                indicator.TickBuffer = tickBuffer;
                Indicators.Add(indicator);
                indicator.SetUp();

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