Skip to main content

Double EMA (DEMA) in the Trade Rule Block

The Double Exponential Moving Average follows price more closely than a regular EMA.

Purpose of the DEMA

The Double Exponential Moving Average (DEMA), developed by Patrick Mulloy, combines a single and a double exponential moving average to reduce lag. It reacts faster to price changes than a regular EMA of the same period, while still smoothing out noise.

How It Works

When you select Double EMA (DEMA) in the Trade Rule block, you can configure it with the following settings:

Period of DEMA

  • The number of candles used for the calculation.

  • Example: A period of 14 uses the last 14 candles.

Shift of DEMA (Advanced Option)

  • Moves the line forward or backward on the chart by a set number of candles.

Applied Price of DEMA (What the DEMA is calculated from)

  • Close Price: Uses the candle's closing price.

  • Open Price: Uses the candle's opening price.

  • High Price: Uses the highest price in the candle.

  • Low Price: Uses the lowest price in the candle.

  • Median Price: (High + Low) ÷ 2

  • Typical Price: (High + Low + Close) ÷ 3

  • Weighted Price: (High + Low + Open + Close) ÷ 4

Time Frame of DEMA

  • Sets the chart time frame for the DEMA calculation.

  • Can be replaced with a variable or input for quick testing and optimization.

Candle ID of DEMA

  • Defines which candle the calculation starts from.

  • 0: Current candle (still forming).

  • 1: Most recently closed candle.

  • Higher IDs refer to older candles.

Adjust of DEMA (Modify the Result)

  • Apply an adjustment to the calculated value by adding, subtracting, multiplying, or dividing by a number.

Example

If you set:

  • Period: 14

  • Applied Price: Close

  • Candle ID: 1

You get the DEMA value of the most recently closed candle, calculated from closing prices.

Double EMA (DEMA) settings in the Profectus Trade Rule block

Use Cases

  • Use price above or below the DEMA as a fast trend filter.

  • Use two DEMAs with different periods for crossover signals.

  • Replace a regular EMA when you want quicker signals.

  • Can also be used as a Custom level stop-loss or take-profit, as a pending-order price, and as the Modify SL/TP reference price.

⚠ Tip: Faster lines give earlier signals but also more false ones. Combine the DEMA with a trend-strength filter such as the ADX.

Did this answer your question?