コード例 #1
0
        /// <summary>
        /// RSX on JMA on price
        /// </summary>
        /// <returns></returns>
        public Jurik_RSX_on_JMA Jurik_RSX_on_JMA(Data.IDataSeries input, double __BotLine, double __TopLine, double _JMA_len, double _JMA_phase, double _RSX_len, double phaseShift)
        {
            if (cacheJurik_RSX_on_JMA != null)
            {
                for (int idx = 0; idx < cacheJurik_RSX_on_JMA.Length; idx++)
                {
                    if (Math.Abs(cacheJurik_RSX_on_JMA[idx].__BotLine - __BotLine) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_JMA[idx].__TopLine - __TopLine) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_JMA[idx]._JMA_len - _JMA_len) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_JMA[idx]._JMA_phase - _JMA_phase) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_JMA[idx]._RSX_len - _RSX_len) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_JMA[idx].PhaseShift - phaseShift) <= double.Epsilon && cacheJurik_RSX_on_JMA[idx].EqualsInput(input))
                    {
                        return(cacheJurik_RSX_on_JMA[idx]);
                    }
                }
            }

            lock (checkJurik_RSX_on_JMA)
            {
                checkJurik_RSX_on_JMA.__BotLine = __BotLine;
                __BotLine = checkJurik_RSX_on_JMA.__BotLine;
                checkJurik_RSX_on_JMA.__TopLine = __TopLine;
                __TopLine = checkJurik_RSX_on_JMA.__TopLine;
                checkJurik_RSX_on_JMA._JMA_len = _JMA_len;
                _JMA_len = checkJurik_RSX_on_JMA._JMA_len;
                checkJurik_RSX_on_JMA._JMA_phase = _JMA_phase;
                _JMA_phase = checkJurik_RSX_on_JMA._JMA_phase;
                checkJurik_RSX_on_JMA._RSX_len = _RSX_len;
                _RSX_len = checkJurik_RSX_on_JMA._RSX_len;
                checkJurik_RSX_on_JMA.PhaseShift = phaseShift;
                phaseShift = checkJurik_RSX_on_JMA.PhaseShift;

                if (cacheJurik_RSX_on_JMA != null)
                {
                    for (int idx = 0; idx < cacheJurik_RSX_on_JMA.Length; idx++)
                    {
                        if (Math.Abs(cacheJurik_RSX_on_JMA[idx].__BotLine - __BotLine) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_JMA[idx].__TopLine - __TopLine) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_JMA[idx]._JMA_len - _JMA_len) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_JMA[idx]._JMA_phase - _JMA_phase) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_JMA[idx]._RSX_len - _RSX_len) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_JMA[idx].PhaseShift - phaseShift) <= double.Epsilon && cacheJurik_RSX_on_JMA[idx].EqualsInput(input))
                        {
                            return(cacheJurik_RSX_on_JMA[idx]);
                        }
                    }
                }

                Jurik_RSX_on_JMA indicator = new Jurik_RSX_on_JMA();
                indicator.BarsRequired        = BarsRequired;
                indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
                indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
                indicator.MaximumBarsLookBack         = MaximumBarsLookBack;
#endif
                indicator.Input      = input;
                indicator.__BotLine  = __BotLine;
                indicator.__TopLine  = __TopLine;
                indicator._JMA_len   = _JMA_len;
                indicator._JMA_phase = _JMA_phase;
                indicator._RSX_len   = _RSX_len;
                indicator.PhaseShift = phaseShift;
                Indicators.Add(indicator);
                indicator.SetUp();

                Jurik_RSX_on_JMA[] tmp = new Jurik_RSX_on_JMA[cacheJurik_RSX_on_JMA == null ? 1 : cacheJurik_RSX_on_JMA.Length + 1];
                if (cacheJurik_RSX_on_JMA != null)
                {
                    cacheJurik_RSX_on_JMA.CopyTo(tmp, 0);
                }
                tmp[tmp.Length - 1]   = indicator;
                cacheJurik_RSX_on_JMA = tmp;
                return(indicator);
            }
        }
コード例 #2
0
        /// <summary>
        /// RSX on JMA on price
        /// </summary>
        /// <returns></returns>
        public Jurik_RSX_on_JMA Jurik_RSX_on_JMA(Data.IDataSeries input, double __BotLine, double __TopLine, double _JMA_len, double _JMA_phase, double _RSX_len, double phaseShift)
        {
            if (cacheJurik_RSX_on_JMA != null)
                for (int idx = 0; idx < cacheJurik_RSX_on_JMA.Length; idx++)
                    if (Math.Abs(cacheJurik_RSX_on_JMA[idx].__BotLine - __BotLine) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_JMA[idx].__TopLine - __TopLine) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_JMA[idx]._JMA_len - _JMA_len) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_JMA[idx]._JMA_phase - _JMA_phase) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_JMA[idx]._RSX_len - _RSX_len) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_JMA[idx].PhaseShift - phaseShift) <= double.Epsilon && cacheJurik_RSX_on_JMA[idx].EqualsInput(input))
                        return cacheJurik_RSX_on_JMA[idx];

            lock (checkJurik_RSX_on_JMA)
            {
                checkJurik_RSX_on_JMA.__BotLine = __BotLine;
                __BotLine = checkJurik_RSX_on_JMA.__BotLine;
                checkJurik_RSX_on_JMA.__TopLine = __TopLine;
                __TopLine = checkJurik_RSX_on_JMA.__TopLine;
                checkJurik_RSX_on_JMA._JMA_len = _JMA_len;
                _JMA_len = checkJurik_RSX_on_JMA._JMA_len;
                checkJurik_RSX_on_JMA._JMA_phase = _JMA_phase;
                _JMA_phase = checkJurik_RSX_on_JMA._JMA_phase;
                checkJurik_RSX_on_JMA._RSX_len = _RSX_len;
                _RSX_len = checkJurik_RSX_on_JMA._RSX_len;
                checkJurik_RSX_on_JMA.PhaseShift = phaseShift;
                phaseShift = checkJurik_RSX_on_JMA.PhaseShift;

                if (cacheJurik_RSX_on_JMA != null)
                    for (int idx = 0; idx < cacheJurik_RSX_on_JMA.Length; idx++)
                        if (Math.Abs(cacheJurik_RSX_on_JMA[idx].__BotLine - __BotLine) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_JMA[idx].__TopLine - __TopLine) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_JMA[idx]._JMA_len - _JMA_len) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_JMA[idx]._JMA_phase - _JMA_phase) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_JMA[idx]._RSX_len - _RSX_len) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_JMA[idx].PhaseShift - phaseShift) <= double.Epsilon && cacheJurik_RSX_on_JMA[idx].EqualsInput(input))
                            return cacheJurik_RSX_on_JMA[idx];

                Jurik_RSX_on_JMA indicator = new Jurik_RSX_on_JMA();
                indicator.BarsRequired = BarsRequired;
                indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
                indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
                indicator.MaximumBarsLookBack = MaximumBarsLookBack;
#endif
                indicator.Input = input;
                indicator.__BotLine = __BotLine;
                indicator.__TopLine = __TopLine;
                indicator._JMA_len = _JMA_len;
                indicator._JMA_phase = _JMA_phase;
                indicator._RSX_len = _RSX_len;
                indicator.PhaseShift = phaseShift;
                Indicators.Add(indicator);
                indicator.SetUp();

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