29 private readonly decimal _k;
30 private readonly
int _period;
68 : this($
"EMA({period})", period)
78 : this($
"EMA({period},{smoothingFactor})", period, smoothingFactor)
92 public override bool IsReady => Samples >= _period;
100 _initialValueSMA.Reset();
111 if (Samples <= _period)
113 _initialValueSMA.Update(input);
121 if (Samples == _period)
124 return _initialValueSMA.Current.Value;
127 return input.
Value * _k + Current.Value * (1 - _k);