DEMA

Category: Indicators

The Double Exponential Moving Average (DEMA) is a technical indicator that aims to reduce the lag associated with traditional moving averages, providing a faster response to changes in price data. It is particularly useful in trading systems to detect early signals of market trends.

Syntax:

DEMA[N](price)

Where N represents the number of periods over which the average is calculated, and price indicates the price type (e.g., close, open, high, low).

Calculation:

  • First, calculate MME1, the exponential moving average (EMA) of the selected price over N periods.
  • Next, compute MME2, which is the EMA of MME1 over the same N periods.
  • The DEMA is then calculated using the formula: DEMA = 2 * MME1 – MME2.

Example:

i1 = DEMA[10](open)
a = 0
WHILE Open[1] < i1 DO
    a = a + 1
WEND
RETURN a

This example calculates the 10-period DEMA of the opening prices. It then counts how many consecutive periods the previous open price is less than the DEMA value.

Additional Information:

The DEMA indicator is more responsive than a simple moving average or an EMA, making it advantageous for traders who need to react quickly to price changes. However, its sensitivity can also lead to increased noise, which might generate false signals. It is often used in conjunction with other indicators like the MACD or stochastic oscillator to confirm trends and refine trading strategies.

Logo Logo
Loading...