Member-only story
Stock Trading Strategy Using DEMA & Python
Algorithmic Trading Using the DEMA indicator
Disclaimer: The material in this article is purely educational and should not be taken as professional investment advice. Invest at your own discretion.
The Double Exponential Moving Average or DEMA for short is a technical indicator that uses two exponential moving averages (EMA) to get rid of lag. It was brought to light in an article by Patrick Mulloy called “Smoothing Data With Faster Moving Averages”.
How To Calculate DEMA ?
To Calculate DEMA, you can use a simple formula. The formula Gets the Exponential Moving Average for N-look back periods, let’s call this EMA1.
The formula then takes EMA1 multiplies it by 2 and subtracts that value with the EMA of EMA1 for the same N-look back periods.
That sounds complicated but it is quite simple, let’s take a look at the equation below:
DEMA = 2 * EMA_N — EMA of EMA_N
Where:
EMA_N = The EMA for N look back periods
EMA of EMA_N = The Exponential Moving Average for N look back periods of the EMA for N look back periods (EMA_N)