# 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]);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://indicators.agenatrader.com/standard-indicators/moving-averages/dema-double-exponential-moving-average.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
