---
id: "T:cAlgo.API.MovingAverageType"
kind: "enum"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Indicators/MovingAverageType/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# MovingAverageType (enum)

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

Environments: Desktop supported · CLI supported · Cloud supported.

## Definition

```csharp
public enum MovingAverageType
```

## Examples

C#:

```csharp
using cAlgo.API;
using cAlgo.API.Indicators;

namespace cAlgo
{
    // A sample indicator that shows how to use different types of moving average
    public partial class MovingAverageTypeSample : Indicator
    {
        private MovingAverage _ma;

        protected override void Initialize()
        {
            _ma = Indicators.MovingAverage(Bars.ClosePrices, 14, MovingAverageType);
        }

        public override void Calculate(int index)
        {
            Result[index] = _ma.Result[index];
        }
    }
}
```

Python:

```python
class MovingAverageTypeSample():
    def initialize(self):
        self.ma = api.Indicators.MovingAverage(api.Bars.ClosePrices, 14, api.MovingAverageType)

    def calculate(self, index):
        api.Result[index] = self.ma.Result[index]
```

config.json:

```json
{
  "AccessRights": "None",
  "TimeZone": "UTC",
  "IsOverlay": true,
  "Parameters": [
    {
      "Name": "MovingAverageType",
      "DisplayName": "Type",
      "Type": "Enum",
      "EnumTypeFullName": "cAlgo.API.MovingAverageType",
      "DefaultValue": "Simple"
    }
  ],
  "LineOutputs": [
    {
      "Name": "Result",
      "DisplayName": "Main"
    }
  ]
}
```

## Values

- `MovingAverageType.Simple` — Use uniform weighting. Represents indicator of SimpleMovingAverage type.
- `MovingAverageType.Exponential` — Use exponential weighting. Represents indicator of ExponentialMovingAverage type.
- `MovingAverageType.TimeSeries` — Represents indicator of TimeSeriesMovingAverage type.
- `MovingAverageType.Triangular` — Represents indicator of TriangularMovingAverage type.
- `MovingAverageType.VIDYA` — VIDYA (Variable Index Dynamic Average) variable length weighting. Represents indicator of VariableIndexDynamicAverage type.
- `MovingAverageType.Weighted` — Represents indicator of WeightedMovingAverage type.
- `MovingAverageType.WilderSmoothing` — Represents indicator of WellesWilderSmoothing type.
- `MovingAverageType.Hull` — Represents indicator of HullMovingAverage type.
- `MovingAverageType.DoubleExponential` — Represents indicator of DoubleExponentialMovingAverage type.
- `MovingAverageType.TripleExponential` — Represents indicator of TripleExponentialMovingAverage type.
- `MovingAverageType.KaufmanAdaptive` — Represents indicator of KaufmanAdaptiveMovingAverage type.

