An enumeration of the different MovingAverage weighting (smoothing) methods.


public sealed enum MovingAverageType


Exponential FieldUse exponential weighting. Represents indicator of ExponentialMovingAverage type.
Hull FieldRepresents indicator of HullMovingAverage type.
Simple FieldUse uniform weighting. Represents indicator of SimpleMovingAverage type.
TimeSeries FieldRepresents indicator of TimeSeriesMovingAverage type.
Triangular FieldRepresents indicator of TriangularMovingAverage type.
VIDYA FieldVIDYA (Volatility Index Dynamic Average) variable length weighting. Represents indicator of Vidya type.
Weighted FieldRepresents indicator of WeightedMovingAverage type.
WilderSmoothing FieldRepresents indicator of WellesWilderSmoothing type.

Example 1

using cAlgo.API;
using cAlgo.API.Indicators;
namespace cAlgo
    // A sample indicator that shows how to use different types of moving average
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class MovingAverageTypeSample : Indicator
        private MovingAverage _ma;
        [Parameter("Type", DefaultValue = MovingAverageType.Simple)]
        public MovingAverageType MovingAverageType { get; set; }
        public IndicatorDataSeries Result { get; set; }
        protected override void Initialize()
            _ma = Indicators.MovingAverage(Bars.ClosePrices, 14, MovingAverageType);
        public override void Calculate(int index)
            Result[index] = _ma.Result[index];