RealTest User Guide
RealTest User Guide

 

 

 

 

 

Category

Multi-Bar Functions

Description

Double Exponential Moving Average

Syntax

DEMA(expr, count)

Parameters

expr - data series formula

count - lookback period

Notes

Count is usually thought of as an integer representing a number of bars, but can actually be any decimal value. An EMA is constructed by multiplying each difference between the result so far and the next value by a factor equal to 2 / (count + 1).

Double EMA is calculated as 2 * EMA(expr, count) - EMA(EMA(expr, count)).

Unlike the EMA function, DEMA applies the exponential weight factor from the start of available data rather than beginning with MA(expr, count). This is consistent with how other backtesting software calculates this indicator.

This function supports one-pass calculation when used in the Data Section with a non-variable count.

 

 

 

 

Copyright © 2020-2025 Systematic Solutions, LLC