public Ma(ValueRow source, AverageMethod method, int n) { _source = source; _am = method; _n = n < 1 ? 1 : n; if (_source != null) { _source.Change += Sources_Change; Sources_Change(null, true); } }
public AverageMethodItem(AverageMethod m) { _method = m; }
public Macd(ValueRow src, int longPeriod = 26, int shortPeriod = 12, int signalPeriod = 9, AverageMethod method = AverageMethod.Exponencial) { this.Source1 = new Ma(src, method, longPeriod); this.Source2 = new Ma(src, method, shortPeriod); this.CalcMethod = (s1, s2, i) => { return(s2[i] - s1[i]); }; _signal = new Ma(this, method, signalPeriod); _hist = new Calc2(this, _signal, (m, s, i) => { return(m[i] - s[i]); }); }