PureBytes Links
Trading Reference Links
|
Thanks for replying and sending the ela file, Gerald. 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.
Give my code a try and you'll see what the concept is, it makes it easier
to see when MACD is signaling that the market is finding support and may be
ready to rally from a previous bearish signal, and vice versa.
The code works well on EOD data (I've cleaned it up a little). The problem
occurs when it is applied to live intraday data. If the hist is rising
during a tick, then reverses, that bar becomes a green bar with a red bar
superimposed over it.
************
{TS4 MACD indicator edited to show color changes in Histogram}
Input: FastMA(12),SlowMA(26),MacdMA(9);
Plot1(MACD(Close,FastMA,SlowMA),"MACD");
Plot2(XAverage(MACD(Close,FastMA,SlowMA),MacdMA),"MACDAvg");
Value1 = (Plot1-Plot2);
If Value1 > Value1[1] then Plot3(Value1,"MAup")
Else Plot4(Value1,"MAdn");
|