예제 #1
0
        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);
            }
        }
예제 #2
0
 public AverageMethodItem(AverageMethod m)
 {
     _method = m;
 }
예제 #3
0
파일: Macd.cs 프로젝트: vlshl/pulxer
        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]); });
        }