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