/// <summary> /// RSX double /// </summary> /// <returns></returns> public Jurik_RSX_double Jurik_RSX_double(Data.IDataSeries input, double __LowerBand, double __UpperBand, double _RSX_fast_len, double _RSX_slow_len, double blend, double phaseShift) { if (cacheJurik_RSX_double != null) for (int idx = 0; idx < cacheJurik_RSX_double.Length; idx++) if (Math.Abs(cacheJurik_RSX_double[idx].__LowerBand - __LowerBand) <= double.Epsilon && Math.Abs(cacheJurik_RSX_double[idx].__UpperBand - __UpperBand) <= double.Epsilon && Math.Abs(cacheJurik_RSX_double[idx]._RSX_fast_len - _RSX_fast_len) <= double.Epsilon && Math.Abs(cacheJurik_RSX_double[idx]._RSX_slow_len - _RSX_slow_len) <= double.Epsilon && Math.Abs(cacheJurik_RSX_double[idx].Blend - blend) <= double.Epsilon && Math.Abs(cacheJurik_RSX_double[idx].PhaseShift - phaseShift) <= double.Epsilon && cacheJurik_RSX_double[idx].EqualsInput(input)) return cacheJurik_RSX_double[idx]; lock (checkJurik_RSX_double) { checkJurik_RSX_double.__LowerBand = __LowerBand; __LowerBand = checkJurik_RSX_double.__LowerBand; checkJurik_RSX_double.__UpperBand = __UpperBand; __UpperBand = checkJurik_RSX_double.__UpperBand; checkJurik_RSX_double._RSX_fast_len = _RSX_fast_len; _RSX_fast_len = checkJurik_RSX_double._RSX_fast_len; checkJurik_RSX_double._RSX_slow_len = _RSX_slow_len; _RSX_slow_len = checkJurik_RSX_double._RSX_slow_len; checkJurik_RSX_double.Blend = blend; blend = checkJurik_RSX_double.Blend; checkJurik_RSX_double.PhaseShift = phaseShift; phaseShift = checkJurik_RSX_double.PhaseShift; if (cacheJurik_RSX_double != null) for (int idx = 0; idx < cacheJurik_RSX_double.Length; idx++) if (Math.Abs(cacheJurik_RSX_double[idx].__LowerBand - __LowerBand) <= double.Epsilon && Math.Abs(cacheJurik_RSX_double[idx].__UpperBand - __UpperBand) <= double.Epsilon && Math.Abs(cacheJurik_RSX_double[idx]._RSX_fast_len - _RSX_fast_len) <= double.Epsilon && Math.Abs(cacheJurik_RSX_double[idx]._RSX_slow_len - _RSX_slow_len) <= double.Epsilon && Math.Abs(cacheJurik_RSX_double[idx].Blend - blend) <= double.Epsilon && Math.Abs(cacheJurik_RSX_double[idx].PhaseShift - phaseShift) <= double.Epsilon && cacheJurik_RSX_double[idx].EqualsInput(input)) return cacheJurik_RSX_double[idx]; Jurik_RSX_double indicator = new Jurik_RSX_double(); indicator.BarsRequired = BarsRequired; indicator.CalculateOnBarClose = CalculateOnBarClose; #if NT7 indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256; indicator.MaximumBarsLookBack = MaximumBarsLookBack; #endif indicator.Input = input; indicator.__LowerBand = __LowerBand; indicator.__UpperBand = __UpperBand; indicator._RSX_fast_len = _RSX_fast_len; indicator._RSX_slow_len = _RSX_slow_len; indicator.Blend = blend; indicator.PhaseShift = phaseShift; Indicators.Add(indicator); indicator.SetUp(); Jurik_RSX_double[] tmp = new Jurik_RSX_double[cacheJurik_RSX_double == null ? 1 : cacheJurik_RSX_double.Length + 1]; if (cacheJurik_RSX_double != null) cacheJurik_RSX_double.CopyTo(tmp, 0); tmp[tmp.Length - 1] = indicator; cacheJurik_RSX_double = tmp; return indicator; } }
/// <summary> /// RSX double /// </summary> /// <returns></returns> public Jurik_RSX_double Jurik_RSX_double(Data.IDataSeries input, double __LowerBand, double __UpperBand, double _RSX_fast_len, double _RSX_slow_len, double blend, double phaseShift) { if (cacheJurik_RSX_double != null) { for (int idx = 0; idx < cacheJurik_RSX_double.Length; idx++) { if (Math.Abs(cacheJurik_RSX_double[idx].__LowerBand - __LowerBand) <= double.Epsilon && Math.Abs(cacheJurik_RSX_double[idx].__UpperBand - __UpperBand) <= double.Epsilon && Math.Abs(cacheJurik_RSX_double[idx]._RSX_fast_len - _RSX_fast_len) <= double.Epsilon && Math.Abs(cacheJurik_RSX_double[idx]._RSX_slow_len - _RSX_slow_len) <= double.Epsilon && Math.Abs(cacheJurik_RSX_double[idx].Blend - blend) <= double.Epsilon && Math.Abs(cacheJurik_RSX_double[idx].PhaseShift - phaseShift) <= double.Epsilon && cacheJurik_RSX_double[idx].EqualsInput(input)) { return(cacheJurik_RSX_double[idx]); } } } lock (checkJurik_RSX_double) { checkJurik_RSX_double.__LowerBand = __LowerBand; __LowerBand = checkJurik_RSX_double.__LowerBand; checkJurik_RSX_double.__UpperBand = __UpperBand; __UpperBand = checkJurik_RSX_double.__UpperBand; checkJurik_RSX_double._RSX_fast_len = _RSX_fast_len; _RSX_fast_len = checkJurik_RSX_double._RSX_fast_len; checkJurik_RSX_double._RSX_slow_len = _RSX_slow_len; _RSX_slow_len = checkJurik_RSX_double._RSX_slow_len; checkJurik_RSX_double.Blend = blend; blend = checkJurik_RSX_double.Blend; checkJurik_RSX_double.PhaseShift = phaseShift; phaseShift = checkJurik_RSX_double.PhaseShift; if (cacheJurik_RSX_double != null) { for (int idx = 0; idx < cacheJurik_RSX_double.Length; idx++) { if (Math.Abs(cacheJurik_RSX_double[idx].__LowerBand - __LowerBand) <= double.Epsilon && Math.Abs(cacheJurik_RSX_double[idx].__UpperBand - __UpperBand) <= double.Epsilon && Math.Abs(cacheJurik_RSX_double[idx]._RSX_fast_len - _RSX_fast_len) <= double.Epsilon && Math.Abs(cacheJurik_RSX_double[idx]._RSX_slow_len - _RSX_slow_len) <= double.Epsilon && Math.Abs(cacheJurik_RSX_double[idx].Blend - blend) <= double.Epsilon && Math.Abs(cacheJurik_RSX_double[idx].PhaseShift - phaseShift) <= double.Epsilon && cacheJurik_RSX_double[idx].EqualsInput(input)) { return(cacheJurik_RSX_double[idx]); } } } Jurik_RSX_double indicator = new Jurik_RSX_double(); indicator.BarsRequired = BarsRequired; indicator.CalculateOnBarClose = CalculateOnBarClose; #if NT7 indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256; indicator.MaximumBarsLookBack = MaximumBarsLookBack; #endif indicator.Input = input; indicator.__LowerBand = __LowerBand; indicator.__UpperBand = __UpperBand; indicator._RSX_fast_len = _RSX_fast_len; indicator._RSX_slow_len = _RSX_slow_len; indicator.Blend = blend; indicator.PhaseShift = phaseShift; Indicators.Add(indicator); indicator.SetUp(); Jurik_RSX_double[] tmp = new Jurik_RSX_double[cacheJurik_RSX_double == null ? 1 : cacheJurik_RSX_double.Length + 1]; if (cacheJurik_RSX_double != null) { cacheJurik_RSX_double.CopyTo(tmp, 0); } tmp[tmp.Length - 1] = indicator; cacheJurik_RSX_double = tmp; return(indicator); } }