Exemple #1
0
 protected override void OnStartUp()
 {
     maxlb  = Z20100527FastMAX(High, lookBack);
     minlb  = Z20100527FastMIN(Low, lookBack);
     maxlen = Z20100527FastMAX(High, length);
     minlen = Z20100527FastMIN(Low, length);
     myatr  = ATR(length);
 }
        protected override void OnStartUp()
        {
            _diff = new DataSeries(this);

            curL = new double[4];
            oldL = new double[4];

            sw   = Z20091120SortedWindow(_diff, 5);
            fmax = Z20100527FastMAX(_diff, period);
            fmin = Z20100527FastMIN(_diff, period);
        }
Exemple #3
0
        /// <summary>
        /// Enter the description of your new custom indicator here
        /// </summary>
        /// <returns></returns>
        public Z20100527FastMIN Z20100527FastMIN(Data.IDataSeries input, int period)
        {
            if (cacheZ20100527FastMIN != null)
            {
                for (int idx = 0; idx < cacheZ20100527FastMIN.Length; idx++)
                {
                    if (cacheZ20100527FastMIN[idx].Period == period && cacheZ20100527FastMIN[idx].EqualsInput(input))
                    {
                        return(cacheZ20100527FastMIN[idx]);
                    }
                }
            }

            lock (checkZ20100527FastMIN)
            {
                checkZ20100527FastMIN.Period = period;
                period = checkZ20100527FastMIN.Period;

                if (cacheZ20100527FastMIN != null)
                {
                    for (int idx = 0; idx < cacheZ20100527FastMIN.Length; idx++)
                    {
                        if (cacheZ20100527FastMIN[idx].Period == period && cacheZ20100527FastMIN[idx].EqualsInput(input))
                        {
                            return(cacheZ20100527FastMIN[idx]);
                        }
                    }
                }

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

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