/// <summary> /// Plot dot or line where the traderclutch swing is /// </summary> /// <returns></returns> public ZZSwingIdentifierLow ZZSwingIdentifierLow(Data.IDataSeries input, int swingSize) { if (cacheZZSwingIdentifierLow != null) { for (int idx = 0; idx < cacheZZSwingIdentifierLow.Length; idx++) { if (cacheZZSwingIdentifierLow[idx].SwingSize == swingSize && cacheZZSwingIdentifierLow[idx].EqualsInput(input)) { return(cacheZZSwingIdentifierLow[idx]); } } } lock (checkZZSwingIdentifierLow) { checkZZSwingIdentifierLow.SwingSize = swingSize; swingSize = checkZZSwingIdentifierLow.SwingSize; if (cacheZZSwingIdentifierLow != null) { for (int idx = 0; idx < cacheZZSwingIdentifierLow.Length; idx++) { if (cacheZZSwingIdentifierLow[idx].SwingSize == swingSize && cacheZZSwingIdentifierLow[idx].EqualsInput(input)) { return(cacheZZSwingIdentifierLow[idx]); } } } ZZSwingIdentifierLow indicator = new ZZSwingIdentifierLow(); indicator.BarsRequired = BarsRequired; indicator.CalculateOnBarClose = CalculateOnBarClose; #if NT7 indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256; indicator.MaximumBarsLookBack = MaximumBarsLookBack; #endif indicator.Input = input; indicator.SwingSize = swingSize; Indicators.Add(indicator); indicator.SetUp(); ZZSwingIdentifierLow[] tmp = new ZZSwingIdentifierLow[cacheZZSwingIdentifierLow == null ? 1 : cacheZZSwingIdentifierLow.Length + 1]; if (cacheZZSwingIdentifierLow != null) { cacheZZSwingIdentifierLow.CopyTo(tmp, 0); } tmp[tmp.Length - 1] = indicator; cacheZZSwingIdentifierLow = tmp; return(indicator); } }
/// <summary> /// Plot dot or line where the traderclutch swing is /// </summary> /// <returns></returns> public ZZSwingIdentifierLow ZZSwingIdentifierLow(Data.IDataSeries input, int swingSize) { if (cacheZZSwingIdentifierLow != null) for (int idx = 0; idx < cacheZZSwingIdentifierLow.Length; idx++) if (cacheZZSwingIdentifierLow[idx].SwingSize == swingSize && cacheZZSwingIdentifierLow[idx].EqualsInput(input)) return cacheZZSwingIdentifierLow[idx]; lock (checkZZSwingIdentifierLow) { checkZZSwingIdentifierLow.SwingSize = swingSize; swingSize = checkZZSwingIdentifierLow.SwingSize; if (cacheZZSwingIdentifierLow != null) for (int idx = 0; idx < cacheZZSwingIdentifierLow.Length; idx++) if (cacheZZSwingIdentifierLow[idx].SwingSize == swingSize && cacheZZSwingIdentifierLow[idx].EqualsInput(input)) return cacheZZSwingIdentifierLow[idx]; ZZSwingIdentifierLow indicator = new ZZSwingIdentifierLow(); indicator.BarsRequired = BarsRequired; indicator.CalculateOnBarClose = CalculateOnBarClose; #if NT7 indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256; indicator.MaximumBarsLookBack = MaximumBarsLookBack; #endif indicator.Input = input; indicator.SwingSize = swingSize; Indicators.Add(indicator); indicator.SetUp(); ZZSwingIdentifierLow[] tmp = new ZZSwingIdentifierLow[cacheZZSwingIdentifierLow == null ? 1 : cacheZZSwingIdentifierLow.Length + 1]; if (cacheZZSwingIdentifierLow != null) cacheZZSwingIdentifierLow.CopyTo(tmp, 0); tmp[tmp.Length - 1] = indicator; cacheZZSwingIdentifierLow = tmp; return indicator; } }