ZeroLag MACD

Category: Indicators By: Nicolas Created: October 26, 2015, 9:12 PM
October 26, 2015, 9:12 PM
Indicators
13 Comments

Here is the traditionnal MACD (Moving Average Convergence Divergence) indicator made with the “zero lag” calculation process.

The default values are : 26 (long) , 12 (short) and 9 for the signal line.

EMAshort1 = exponentialaverage[short](close)
EMAshort2 = exponentialaverage[short](EMAshort1)
DifferenceShort = EMAshort1 - EMAshort2
ZeroLagShort = EMAshort1 + DifferenceShort

EMAlong1 = exponentialaverage[long](close)
EMAlong2 = exponentialaverage[long](EMAlong1)
DifferenceLong = EMAlong1 - EMAlong2
ZeroLagLong = EMAlong1 + DifferenceLong

ZeroLagMACD = ZeroLagShort - ZeroLagLong

signal1=ExponentialAverage[signal](ZEROLAGMACD)
signal2=ExponentialAverage[signal](signal1)
DIFFERENCE2=signal1-signal2

SignalMACD=signal1+DIFFERENCE2

RETURN ZeroLagMACD as "Zero Lag MACD", SignalMACD as "Signal MACD"

 

Download
Filename: ZeroLag-MACD.itf
Downloads: 707
Nicolas Master
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

Logo Logo
Loading...