Esempio n. 1
0
        /// <summary>
        /// Jurik DMX (Directional Movement Index) is a smoother version of the technical indicator DMI, while retaining very fast response speed.
        /// </summary>
        /// <returns></returns>
        public JurikDMX JurikDMX(Data.IDataSeries input, int smoothing)
        {
            checkJurikDMX.Smoothing = smoothing;
            smoothing = checkJurikDMX.Smoothing;

            if (cacheJurikDMX != null)
            {
                for (int idx = 0; idx < cacheJurikDMX.Length; idx++)
                {
                    if (cacheJurikDMX[idx].Smoothing == smoothing && cacheJurikDMX[idx].EqualsInput(input))
                    {
                        return(cacheJurikDMX[idx]);
                    }
                }
            }

            JurikDMX indicator = new JurikDMX();

            indicator.SetUp();
            indicator.CalculateOnBarClose = CalculateOnBarClose;
            indicator.Input     = input;
            indicator.Smoothing = smoothing;

            JurikDMX[] tmp = new JurikDMX[cacheJurikDMX == null ? 1 : cacheJurikDMX.Length + 1];
            if (cacheJurikDMX != null)
            {
                cacheJurikDMX.CopyTo(tmp, 0);
            }
            tmp[tmp.Length - 1] = indicator;
            cacheJurikDMX       = tmp;
            Indicators.Add(indicator);

            return(indicator);
        }
Esempio n. 2
0
        /// <summary>
        /// Jurik DMX (Directional Movement Index) is a smoother version of the technical indicator DMI, while retaining very fast response speed.
        /// </summary>
        /// <returns></returns>
        public JurikDMX JurikDMX(Data.IDataSeries input, int smoothing)
        {
            checkJurikDMX.Smoothing = smoothing;
            smoothing = checkJurikDMX.Smoothing;

            if (cacheJurikDMX != null)
                for (int idx = 0; idx < cacheJurikDMX.Length; idx++)
                    if (cacheJurikDMX[idx].Smoothing == smoothing && cacheJurikDMX[idx].EqualsInput(input))
                        return cacheJurikDMX[idx];

            JurikDMX indicator = new JurikDMX();
            indicator.SetUp();
            indicator.CalculateOnBarClose = CalculateOnBarClose;
            indicator.Input = input;
            indicator.Smoothing = smoothing;

            JurikDMX[] tmp = new JurikDMX[cacheJurikDMX == null ? 1 : cacheJurikDMX.Length + 1];
            if (cacheJurikDMX != null)
                cacheJurikDMX.CopyTo(tmp, 0);
            tmp[tmp.Length - 1] = indicator;
            cacheJurikDMX = tmp;
            Indicators.Add(indicator);

            return indicator;
        }