예제 #1
0
        /// <summary>
        /// Plots the open, high, low and close values from the session starting on the prior day.
        /// </summary>
        /// <returns></returns>
        public ZZPriorDayOHLCAlerts ZZPriorDayOHLCAlerts(Data.IDataSeries input)
        {
            if (cacheZZPriorDayOHLCAlerts != null)
            {
                for (int idx = 0; idx < cacheZZPriorDayOHLCAlerts.Length; idx++)
                {
                    if (cacheZZPriorDayOHLCAlerts[idx].EqualsInput(input))
                    {
                        return(cacheZZPriorDayOHLCAlerts[idx]);
                    }
                }
            }

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

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

                ZZPriorDayOHLCAlerts[] tmp = new ZZPriorDayOHLCAlerts[cacheZZPriorDayOHLCAlerts == null ? 1 : cacheZZPriorDayOHLCAlerts.Length + 1];
                if (cacheZZPriorDayOHLCAlerts != null)
                {
                    cacheZZPriorDayOHLCAlerts.CopyTo(tmp, 0);
                }
                tmp[tmp.Length - 1]       = indicator;
                cacheZZPriorDayOHLCAlerts = tmp;
                return(indicator);
            }
        }
        /// <summary>
        /// Plots the open, high, low and close values from the session starting on the prior day.
        /// </summary>
        /// <returns></returns>
        public ZZPriorDayOHLCAlerts ZZPriorDayOHLCAlerts(Data.IDataSeries input)
        {
            if (cacheZZPriorDayOHLCAlerts != null)
                for (int idx = 0; idx < cacheZZPriorDayOHLCAlerts.Length; idx++)
                    if (cacheZZPriorDayOHLCAlerts[idx].EqualsInput(input))
                        return cacheZZPriorDayOHLCAlerts[idx];

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

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

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