/// <summary> /// Tick per Second /// </summary> /// <returns></returns> public ZZQuoteMonitor ZZQuoteMonitor(Data.IDataSeries input) { if (cacheZZQuoteMonitor != null) { for (int idx = 0; idx < cacheZZQuoteMonitor.Length; idx++) { if (cacheZZQuoteMonitor[idx].EqualsInput(input)) { return(cacheZZQuoteMonitor[idx]); } } } lock (checkZZQuoteMonitor) { if (cacheZZQuoteMonitor != null) { for (int idx = 0; idx < cacheZZQuoteMonitor.Length; idx++) { if (cacheZZQuoteMonitor[idx].EqualsInput(input)) { return(cacheZZQuoteMonitor[idx]); } } } ZZQuoteMonitor indicator = new ZZQuoteMonitor(); indicator.BarsRequired = BarsRequired; indicator.CalculateOnBarClose = CalculateOnBarClose; #if NT7 indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256; indicator.MaximumBarsLookBack = MaximumBarsLookBack; #endif indicator.Input = input; Indicators.Add(indicator); indicator.SetUp(); ZZQuoteMonitor[] tmp = new ZZQuoteMonitor[cacheZZQuoteMonitor == null ? 1 : cacheZZQuoteMonitor.Length + 1]; if (cacheZZQuoteMonitor != null) { cacheZZQuoteMonitor.CopyTo(tmp, 0); } tmp[tmp.Length - 1] = indicator; cacheZZQuoteMonitor = tmp; return(indicator); } }
/// <summary> /// Tick per Second /// </summary> /// <returns></returns> public ZZQuoteMonitor ZZQuoteMonitor(Data.IDataSeries input) { if (cacheZZQuoteMonitor != null) for (int idx = 0; idx < cacheZZQuoteMonitor.Length; idx++) if (cacheZZQuoteMonitor[idx].EqualsInput(input)) return cacheZZQuoteMonitor[idx]; lock (checkZZQuoteMonitor) { if (cacheZZQuoteMonitor != null) for (int idx = 0; idx < cacheZZQuoteMonitor.Length; idx++) if (cacheZZQuoteMonitor[idx].EqualsInput(input)) return cacheZZQuoteMonitor[idx]; ZZQuoteMonitor indicator = new ZZQuoteMonitor(); indicator.BarsRequired = BarsRequired; indicator.CalculateOnBarClose = CalculateOnBarClose; #if NT7 indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256; indicator.MaximumBarsLookBack = MaximumBarsLookBack; #endif indicator.Input = input; Indicators.Add(indicator); indicator.SetUp(); ZZQuoteMonitor[] tmp = new ZZQuoteMonitor[cacheZZQuoteMonitor == null ? 1 : cacheZZQuoteMonitor.Length + 1]; if (cacheZZQuoteMonitor != null) cacheZZQuoteMonitor.CopyTo(tmp, 0); tmp[tmp.Length - 1] = indicator; cacheZZQuoteMonitor = tmp; return indicator; } }