Wilders Moving Average in C# (RMA)

Note, base page can be found here. Also, I only post these indicators once I have written unit tests against them. Please comment below if something doesn’t look right.

    
 	public class WildersMovingAverage : IndicatorBase
    {
        public decimal[] Result { get; set; }

        public int Period = 14;

        public decimal _previousSum = 0;

        public WildersMovingAverage(IEnumerable<Candle> candles, int length)
            : base(candles)
        {
            Period = length;
        }

        protected override void Initialize()
        {
            Result = new decimal[Series.Length];
        }

        public override void Compute(int startIndex = 0, int? endIndex = null)
        {
            if (endIndex == null)
                endIndex = Series.Length;

            decimal alpha = 1m / Period;
            for (int index = startIndex; index < endIndex; index++)
            {
                Result[index] = alpha * Series.Close[index] + (1 - alpha) * _previousSum;
                _previousSum = Result[index];
            }
        }
    }