> For the complete documentation index, see [llms.txt](https://indicators.agenatrader.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://indicators.agenatrader.com/standard-indicators/moving-averages/dema-double-exponential-moving-average.md).

# DEMA - Double Exponential Moving Average

#### Description <a href="#description_60" id="description_60"></a>

The Double Exponential Moving Average is a technical indicator created by Patrick Mulloy. The calculation hereof is done using a simple as well as a double exponential moving average.

#### Interpretation <a href="#interpretation_30" id="interpretation_30"></a>

The DEMA is a fast-working moving average that reacts quicker to market changes. The DEMA may be used as a stand-alone indicator or in tandem with other indicators. The general interpretations are the same as for regular moving averages.

#### Usage <a href="#usage_62" id="usage_62"></a>

```csharp
DEMA(int period)
DEMA(IDataSeries inSeries, int period)
DEMA(int period)[int barsAgo]
DEMA(IDataSeries inSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_59" id="return-value_59"></a>

**double**

When using this method with an index (e.g. **DEMA**(20)\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

#### Parameters <a href="#parameters_52" id="parameters_52"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_55" id="visualization_55"></a>

![DEMA - Double Exponential Moving Average](https://agenatrader.github.io/AgenaIndicator-documentation/media/DEMA.jpg)

#### Calculation <a href="#calculation_2" id="calculation_2"></a>

```csharp
Value.Set(2 * EMA(InSeries[0], Period)[0] - EMA(EMA(InSeries[0], Period), Period)[0]);
```

#### Example <a href="#example_58" id="example_58"></a>

```csharp
//Output the values for the DEMA
Print("The current DEMA value is " + DEMA(20)[0]);
```
