25 private readonly decimal _slowSmoothingFactor;
26 private readonly decimal _diffSmoothingFactor;
27 private decimal _prevKama;
40 _slowSmoothingFactor = 2m / (slowEmaPeriod + 1m);
42 _diffSmoothingFactor = 2m / (fastEmaPeriod + 1m) - _slowSmoothingFactor;
52 : this($
"KAMA({period},{fastEmaPeriod},{slowEmaPeriod})", period, fastEmaPeriod, slowEmaPeriod)
65 var efficiencyRatio = base.ComputeNextValue(window, input);
76 _prevKama = window[1].Value;
80 var smoothingConstant = efficiencyRatio * _diffSmoothingFactor + _slowSmoothingFactor;
81 smoothingConstant *= smoothingConstant;
85 _prevKama = (input.
Value - _prevKama) * smoothingConstant + _prevKama;