/// <summary> /// Variation of the VOL (Volume) indicator that colors the volume histogram different color depending if the current bar is up or down bar /// </summary> /// <returns></returns> public ZZTapeMonitor ZZTapeMonitor(Data.IDataSeries input) { if (cacheZZTapeMonitor != null) { for (int idx = 0; idx < cacheZZTapeMonitor.Length; idx++) { if (cacheZZTapeMonitor[idx].EqualsInput(input)) { return(cacheZZTapeMonitor[idx]); } } } lock (checkZZTapeMonitor) { if (cacheZZTapeMonitor != null) { for (int idx = 0; idx < cacheZZTapeMonitor.Length; idx++) { if (cacheZZTapeMonitor[idx].EqualsInput(input)) { return(cacheZZTapeMonitor[idx]); } } } ZZTapeMonitor indicator = new ZZTapeMonitor(); indicator.BarsRequired = BarsRequired; indicator.CalculateOnBarClose = CalculateOnBarClose; #if NT7 indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256; indicator.MaximumBarsLookBack = MaximumBarsLookBack; #endif indicator.Input = input; Indicators.Add(indicator); indicator.SetUp(); ZZTapeMonitor[] tmp = new ZZTapeMonitor[cacheZZTapeMonitor == null ? 1 : cacheZZTapeMonitor.Length + 1]; if (cacheZZTapeMonitor != null) { cacheZZTapeMonitor.CopyTo(tmp, 0); } tmp[tmp.Length - 1] = indicator; cacheZZTapeMonitor = tmp; return(indicator); } }
/// <summary> /// Variation of the VOL (Volume) indicator that colors the volume histogram different color depending if the current bar is up or down bar /// </summary> /// <returns></returns> public ZZTapeMonitor ZZTapeMonitor(Data.IDataSeries input) { if (cacheZZTapeMonitor != null) for (int idx = 0; idx < cacheZZTapeMonitor.Length; idx++) if (cacheZZTapeMonitor[idx].EqualsInput(input)) return cacheZZTapeMonitor[idx]; lock (checkZZTapeMonitor) { if (cacheZZTapeMonitor != null) for (int idx = 0; idx < cacheZZTapeMonitor.Length; idx++) if (cacheZZTapeMonitor[idx].EqualsInput(input)) return cacheZZTapeMonitor[idx]; ZZTapeMonitor indicator = new ZZTapeMonitor(); indicator.BarsRequired = BarsRequired; indicator.CalculateOnBarClose = CalculateOnBarClose; #if NT7 indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256; indicator.MaximumBarsLookBack = MaximumBarsLookBack; #endif indicator.Input = input; Indicators.Add(indicator); indicator.SetUp(); ZZTapeMonitor[] tmp = new ZZTapeMonitor[cacheZZTapeMonitor == null ? 1 : cacheZZTapeMonitor.Length + 1]; if (cacheZZTapeMonitor != null) cacheZZTapeMonitor.CopyTo(tmp, 0); tmp[tmp.Length - 1] = indicator; cacheZZTapeMonitor = tmp; return indicator; } }