/// <summary> /// Enter the description of your new custom indicator here /// </summary> /// <returns></returns> public GomDeltaMomentum GomDeltaMomentum(Data.IDataSeries input) { if (cacheGomDeltaMomentum != null) { for (int idx = 0; idx < cacheGomDeltaMomentum.Length; idx++) { if (cacheGomDeltaMomentum[idx].EqualsInput(input)) { return(cacheGomDeltaMomentum[idx]); } } } lock (checkGomDeltaMomentum) { if (cacheGomDeltaMomentum != null) { for (int idx = 0; idx < cacheGomDeltaMomentum.Length; idx++) { if (cacheGomDeltaMomentum[idx].EqualsInput(input)) { return(cacheGomDeltaMomentum[idx]); } } } GomDeltaMomentum indicator = new GomDeltaMomentum(); indicator.BarsRequired = BarsRequired; indicator.CalculateOnBarClose = CalculateOnBarClose; #if NT7 indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256; indicator.MaximumBarsLookBack = MaximumBarsLookBack; #endif indicator.Input = input; Indicators.Add(indicator); indicator.SetUp(); GomDeltaMomentum[] tmp = new GomDeltaMomentum[cacheGomDeltaMomentum == null ? 1 : cacheGomDeltaMomentum.Length + 1]; if (cacheGomDeltaMomentum != null) { cacheGomDeltaMomentum.CopyTo(tmp, 0); } tmp[tmp.Length - 1] = indicator; cacheGomDeltaMomentum = tmp; return(indicator); } }
/// <summary> /// Enter the description of your new custom indicator here /// </summary> /// <returns></returns> public GomDeltaMomentum GomDeltaMomentum(Data.IDataSeries input) { if (cacheGomDeltaMomentum != null) for (int idx = 0; idx < cacheGomDeltaMomentum.Length; idx++) if (cacheGomDeltaMomentum[idx].EqualsInput(input)) return cacheGomDeltaMomentum[idx]; lock (checkGomDeltaMomentum) { if (cacheGomDeltaMomentum != null) for (int idx = 0; idx < cacheGomDeltaMomentum.Length; idx++) if (cacheGomDeltaMomentum[idx].EqualsInput(input)) return cacheGomDeltaMomentum[idx]; GomDeltaMomentum indicator = new GomDeltaMomentum(); indicator.BarsRequired = BarsRequired; indicator.CalculateOnBarClose = CalculateOnBarClose; #if NT7 indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256; indicator.MaximumBarsLookBack = MaximumBarsLookBack; #endif indicator.Input = input; Indicators.Add(indicator); indicator.SetUp(); GomDeltaMomentum[] tmp = new GomDeltaMomentum[cacheGomDeltaMomentum == null ? 1 : cacheGomDeltaMomentum.Length + 1]; if (cacheGomDeltaMomentum != null) cacheGomDeltaMomentum.CopyTo(tmp, 0); tmp[tmp.Length - 1] = indicator; cacheGomDeltaMomentum = tmp; return indicator; } }