/// <summary> /// VEL double /// </summary> /// <returns></returns> public Jurik_VEL_double Jurik_VEL_double(Data.IDataSeries input, double __LowerBand, double __UpperBand, int _VEL_fast_len, int _VEL_slow_len, double blend, double phaseShift) { if (cacheJurik_VEL_double != null) { for (int idx = 0; idx < cacheJurik_VEL_double.Length; idx++) { if (Math.Abs(cacheJurik_VEL_double[idx].__LowerBand - __LowerBand) <= double.Epsilon && Math.Abs(cacheJurik_VEL_double[idx].__UpperBand - __UpperBand) <= double.Epsilon && cacheJurik_VEL_double[idx]._VEL_fast_len == _VEL_fast_len && cacheJurik_VEL_double[idx]._VEL_slow_len == _VEL_slow_len && Math.Abs(cacheJurik_VEL_double[idx].Blend - blend) <= double.Epsilon && Math.Abs(cacheJurik_VEL_double[idx].PhaseShift - phaseShift) <= double.Epsilon && cacheJurik_VEL_double[idx].EqualsInput(input)) { return(cacheJurik_VEL_double[idx]); } } } lock (checkJurik_VEL_double) { checkJurik_VEL_double.__LowerBand = __LowerBand; __LowerBand = checkJurik_VEL_double.__LowerBand; checkJurik_VEL_double.__UpperBand = __UpperBand; __UpperBand = checkJurik_VEL_double.__UpperBand; checkJurik_VEL_double._VEL_fast_len = _VEL_fast_len; _VEL_fast_len = checkJurik_VEL_double._VEL_fast_len; checkJurik_VEL_double._VEL_slow_len = _VEL_slow_len; _VEL_slow_len = checkJurik_VEL_double._VEL_slow_len; checkJurik_VEL_double.Blend = blend; blend = checkJurik_VEL_double.Blend; checkJurik_VEL_double.PhaseShift = phaseShift; phaseShift = checkJurik_VEL_double.PhaseShift; if (cacheJurik_VEL_double != null) { for (int idx = 0; idx < cacheJurik_VEL_double.Length; idx++) { if (Math.Abs(cacheJurik_VEL_double[idx].__LowerBand - __LowerBand) <= double.Epsilon && Math.Abs(cacheJurik_VEL_double[idx].__UpperBand - __UpperBand) <= double.Epsilon && cacheJurik_VEL_double[idx]._VEL_fast_len == _VEL_fast_len && cacheJurik_VEL_double[idx]._VEL_slow_len == _VEL_slow_len && Math.Abs(cacheJurik_VEL_double[idx].Blend - blend) <= double.Epsilon && Math.Abs(cacheJurik_VEL_double[idx].PhaseShift - phaseShift) <= double.Epsilon && cacheJurik_VEL_double[idx].EqualsInput(input)) { return(cacheJurik_VEL_double[idx]); } } } Jurik_VEL_double indicator = new Jurik_VEL_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._VEL_fast_len = _VEL_fast_len; indicator._VEL_slow_len = _VEL_slow_len; indicator.Blend = blend; indicator.PhaseShift = phaseShift; Indicators.Add(indicator); indicator.SetUp(); Jurik_VEL_double[] tmp = new Jurik_VEL_double[cacheJurik_VEL_double == null ? 1 : cacheJurik_VEL_double.Length + 1]; if (cacheJurik_VEL_double != null) { cacheJurik_VEL_double.CopyTo(tmp, 0); } tmp[tmp.Length - 1] = indicator; cacheJurik_VEL_double = tmp; return(indicator); } }
/// <summary> /// VEL double /// </summary> /// <returns></returns> public Jurik_VEL_double Jurik_VEL_double(Data.IDataSeries input, double __LowerBand, double __UpperBand, int _VEL_fast_len, int _VEL_slow_len, double blend, double phaseShift) { if (cacheJurik_VEL_double != null) for (int idx = 0; idx < cacheJurik_VEL_double.Length; idx++) if (Math.Abs(cacheJurik_VEL_double[idx].__LowerBand - __LowerBand) <= double.Epsilon && Math.Abs(cacheJurik_VEL_double[idx].__UpperBand - __UpperBand) <= double.Epsilon && cacheJurik_VEL_double[idx]._VEL_fast_len == _VEL_fast_len && cacheJurik_VEL_double[idx]._VEL_slow_len == _VEL_slow_len && Math.Abs(cacheJurik_VEL_double[idx].Blend - blend) <= double.Epsilon && Math.Abs(cacheJurik_VEL_double[idx].PhaseShift - phaseShift) <= double.Epsilon && cacheJurik_VEL_double[idx].EqualsInput(input)) return cacheJurik_VEL_double[idx]; lock (checkJurik_VEL_double) { checkJurik_VEL_double.__LowerBand = __LowerBand; __LowerBand = checkJurik_VEL_double.__LowerBand; checkJurik_VEL_double.__UpperBand = __UpperBand; __UpperBand = checkJurik_VEL_double.__UpperBand; checkJurik_VEL_double._VEL_fast_len = _VEL_fast_len; _VEL_fast_len = checkJurik_VEL_double._VEL_fast_len; checkJurik_VEL_double._VEL_slow_len = _VEL_slow_len; _VEL_slow_len = checkJurik_VEL_double._VEL_slow_len; checkJurik_VEL_double.Blend = blend; blend = checkJurik_VEL_double.Blend; checkJurik_VEL_double.PhaseShift = phaseShift; phaseShift = checkJurik_VEL_double.PhaseShift; if (cacheJurik_VEL_double != null) for (int idx = 0; idx < cacheJurik_VEL_double.Length; idx++) if (Math.Abs(cacheJurik_VEL_double[idx].__LowerBand - __LowerBand) <= double.Epsilon && Math.Abs(cacheJurik_VEL_double[idx].__UpperBand - __UpperBand) <= double.Epsilon && cacheJurik_VEL_double[idx]._VEL_fast_len == _VEL_fast_len && cacheJurik_VEL_double[idx]._VEL_slow_len == _VEL_slow_len && Math.Abs(cacheJurik_VEL_double[idx].Blend - blend) <= double.Epsilon && Math.Abs(cacheJurik_VEL_double[idx].PhaseShift - phaseShift) <= double.Epsilon && cacheJurik_VEL_double[idx].EqualsInput(input)) return cacheJurik_VEL_double[idx]; Jurik_VEL_double indicator = new Jurik_VEL_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._VEL_fast_len = _VEL_fast_len; indicator._VEL_slow_len = _VEL_slow_len; indicator.Blend = blend; indicator.PhaseShift = phaseShift; Indicators.Add(indicator); indicator.SetUp(); Jurik_VEL_double[] tmp = new Jurik_VEL_double[cacheJurik_VEL_double == null ? 1 : cacheJurik_VEL_double.Length + 1]; if (cacheJurik_VEL_double != null) cacheJurik_VEL_double.CopyTo(tmp, 0); tmp[tmp.Length - 1] = indicator; cacheJurik_VEL_double = tmp; return indicator; } }