PureBytes Links
Trading Reference Links
|
> What I was trying to
> code was an indicator that would paint the MACD hist bar green if it has
> risen in relation to the previous bar (increased value), and paint the MACD
> hist bar red if it is lower than the previous bar (decreased value),
> regardless of whether the bar is above or below the zero line.
This could be coded to run much faster but it should do what you want.
Input: FastMA(12),SlowMA(26),MacdMA(9);
value1 = MACD(Close,FastMA,SlowMA);
value2 = XAverage(MACD(Close,FastMA,SlowMA),MacdMA);
if value1 > value1[1] then plot1(value1,"MACD Up") else {green hist}
if value1 < value1[1] then plot2(value1,"MACD Down") else {red hist}
plot3(value1,"MACD Flat"); {yellow hist}
plot4(value2, "MACD Avg"); {line}
--
Dennis
|