Hello.
Im new to this and trying to make a indicator that uses EMA5 and 14 and MACD.
i want one indicator that shows 1 if EMA5 above EMA14 and The blue line is above the red in MACD.
Also if possible, id like it to show -1 if EMA5 below EMA14 and blue line under red in MACD
else show 0.
I get the EMA5/14 part. but cant figure out how to code the MACD.
Thankfully accepting pointers:)
Hi jonas,
That’s what I coded according to what was requested.
macdline0 = MACDline[12,26,9](close)
macd0 = MACD[12,26,9](close)
ema5 = ExponentialAverage[5](close)
ema14 = ExponentialAverage[14](close)
macdbull = macdline0 > macd0
macdbear = macdline0 < macd0
emabull = ema5 > ema14
emabear = ema5 < ema14
if macdbull and emabull then
dir = 1
elsif macdbear and emabear then
dir = -1
else
dir = 0
endif
return dir
Have you taken account that the PRT MACD is not like everybody’s else’s MACD?? See / read below
Surely such a basic Indicator as the MACD can’t be wrong in the standard PRT listings???