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

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

# DoubleExponentialMovingAverage (interface)

The Double Exponential Moving Average (DEMA) is a combination of smoothed exponential moving averages (EMA) and a basic EMA

Environments: Desktop supported · CLI supported · Cloud supported.

## Definition

```csharp
public interface DoubleExponentialMovingAverage
```

## Examples

C#:

```csharp
private DoubleExponentialMovingAverage _dema;

protected override void OnStart()
{
    _dema = Indicators.DoubleExponentialMovingAverage(Bars.ClosePrices, 21);
}

protected override void OnBar()
{
    if (Bars.ClosePrices.Last(1) > _dema.Result.Last(1))
        Print("Close is above DEMA: {0}", _dema.Result.Last(1));
}
```

Python:

```python
def on_start(self):
    self.dema = api.Indicators.DoubleExponentialMovingAverage(api.Bars.ClosePrices, 21)

def on_bar(self):
    if api.Bars.ClosePrices.Last(1) > self.dema.Result.Last(1):
        api.Print(f"Close is above DEMA: {self.dema.Result.Last(1)}")
```

## Inherited members

- `IndicatorDataSeries Result {get;}` (from MovingAverage) [details](https://help.ctrader.com/ctrader-algo/references/Indicators/MovingAverage/Result/index.md)
- `ChartIndicator AddToChart()` (from StandardIndicator) [details](https://help.ctrader.com/ctrader-algo/references/General/StandardIndicator/AddToChart/index.md)
- `Symbol Symbol {get;}` (from StandardIndicator) [details](https://help.ctrader.com/ctrader-algo/references/General/StandardIndicator/Symbol/index.md)
- `TimeFrame TimeFrame {get;}` (from StandardIndicator) [details](https://help.ctrader.com/ctrader-algo/references/General/StandardIndicator/TimeFrame/index.md)
- `Bars Bars {get;}` (from StandardIndicator) [details](https://help.ctrader.com/ctrader-algo/references/General/StandardIndicator/Bars/index.md)

