/// <summary> /// RSX on RSX on price /// </summary> /// <returns></returns> public Jurik_RSX_on_RSX Jurik_RSX_on_RSX(Data.IDataSeries input, double __LowerBand, double __UpperBand, double _RSX_len, double blend, double phaseShift) { if (cacheJurik_RSX_on_RSX != null) { for (int idx = 0; idx < cacheJurik_RSX_on_RSX.Length; idx++) { if (Math.Abs(cacheJurik_RSX_on_RSX[idx].__LowerBand - __LowerBand) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_RSX[idx].__UpperBand - __UpperBand) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_RSX[idx]._RSX_len - _RSX_len) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_RSX[idx].Blend - blend) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_RSX[idx].PhaseShift - phaseShift) <= double.Epsilon && cacheJurik_RSX_on_RSX[idx].EqualsInput(input)) { return(cacheJurik_RSX_on_RSX[idx]); } } } lock (checkJurik_RSX_on_RSX) { checkJurik_RSX_on_RSX.__LowerBand = __LowerBand; __LowerBand = checkJurik_RSX_on_RSX.__LowerBand; checkJurik_RSX_on_RSX.__UpperBand = __UpperBand; __UpperBand = checkJurik_RSX_on_RSX.__UpperBand; checkJurik_RSX_on_RSX._RSX_len = _RSX_len; _RSX_len = checkJurik_RSX_on_RSX._RSX_len; checkJurik_RSX_on_RSX.Blend = blend; blend = checkJurik_RSX_on_RSX.Blend; checkJurik_RSX_on_RSX.PhaseShift = phaseShift; phaseShift = checkJurik_RSX_on_RSX.PhaseShift; if (cacheJurik_RSX_on_RSX != null) { for (int idx = 0; idx < cacheJurik_RSX_on_RSX.Length; idx++) { if (Math.Abs(cacheJurik_RSX_on_RSX[idx].__LowerBand - __LowerBand) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_RSX[idx].__UpperBand - __UpperBand) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_RSX[idx]._RSX_len - _RSX_len) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_RSX[idx].Blend - blend) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_RSX[idx].PhaseShift - phaseShift) <= double.Epsilon && cacheJurik_RSX_on_RSX[idx].EqualsInput(input)) { return(cacheJurik_RSX_on_RSX[idx]); } } } Jurik_RSX_on_RSX indicator = new Jurik_RSX_on_RSX(); 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_len = _RSX_len; indicator.Blend = blend; indicator.PhaseShift = phaseShift; Indicators.Add(indicator); indicator.SetUp(); Jurik_RSX_on_RSX[] tmp = new Jurik_RSX_on_RSX[cacheJurik_RSX_on_RSX == null ? 1 : cacheJurik_RSX_on_RSX.Length + 1]; if (cacheJurik_RSX_on_RSX != null) { cacheJurik_RSX_on_RSX.CopyTo(tmp, 0); } tmp[tmp.Length - 1] = indicator; cacheJurik_RSX_on_RSX = tmp; return(indicator); } }
/// <summary> /// RSX on RSX on price /// </summary> /// <returns></returns> public Jurik_RSX_on_RSX Jurik_RSX_on_RSX(Data.IDataSeries input, double __LowerBand, double __UpperBand, double _RSX_len, double blend, double phaseShift) { if (cacheJurik_RSX_on_RSX != null) for (int idx = 0; idx < cacheJurik_RSX_on_RSX.Length; idx++) if (Math.Abs(cacheJurik_RSX_on_RSX[idx].__LowerBand - __LowerBand) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_RSX[idx].__UpperBand - __UpperBand) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_RSX[idx]._RSX_len - _RSX_len) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_RSX[idx].Blend - blend) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_RSX[idx].PhaseShift - phaseShift) <= double.Epsilon && cacheJurik_RSX_on_RSX[idx].EqualsInput(input)) return cacheJurik_RSX_on_RSX[idx]; lock (checkJurik_RSX_on_RSX) { checkJurik_RSX_on_RSX.__LowerBand = __LowerBand; __LowerBand = checkJurik_RSX_on_RSX.__LowerBand; checkJurik_RSX_on_RSX.__UpperBand = __UpperBand; __UpperBand = checkJurik_RSX_on_RSX.__UpperBand; checkJurik_RSX_on_RSX._RSX_len = _RSX_len; _RSX_len = checkJurik_RSX_on_RSX._RSX_len; checkJurik_RSX_on_RSX.Blend = blend; blend = checkJurik_RSX_on_RSX.Blend; checkJurik_RSX_on_RSX.PhaseShift = phaseShift; phaseShift = checkJurik_RSX_on_RSX.PhaseShift; if (cacheJurik_RSX_on_RSX != null) for (int idx = 0; idx < cacheJurik_RSX_on_RSX.Length; idx++) if (Math.Abs(cacheJurik_RSX_on_RSX[idx].__LowerBand - __LowerBand) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_RSX[idx].__UpperBand - __UpperBand) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_RSX[idx]._RSX_len - _RSX_len) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_RSX[idx].Blend - blend) <= double.Epsilon && Math.Abs(cacheJurik_RSX_on_RSX[idx].PhaseShift - phaseShift) <= double.Epsilon && cacheJurik_RSX_on_RSX[idx].EqualsInput(input)) return cacheJurik_RSX_on_RSX[idx]; Jurik_RSX_on_RSX indicator = new Jurik_RSX_on_RSX(); 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_len = _RSX_len; indicator.Blend = blend; indicator.PhaseShift = phaseShift; Indicators.Add(indicator); indicator.SetUp(); Jurik_RSX_on_RSX[] tmp = new Jurik_RSX_on_RSX[cacheJurik_RSX_on_RSX == null ? 1 : cacheJurik_RSX_on_RSX.Length + 1]; if (cacheJurik_RSX_on_RSX != null) cacheJurik_RSX_on_RSX.CopyTo(tmp, 0); tmp[tmp.Length - 1] = indicator; cacheJurik_RSX_on_RSX = tmp; return indicator; } }