[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Color on Histogram solution



PureBytes Links

Trading Reference Links

You have, what I would believe to be, a minor mistake in the code that
you last posted.  I think you intended the "end;" statement to come
BEFORE the Plot3 and Plot4 statements as is written below.

The way that you posted the code, it would only Plot3 and Plot4 when
value1<=value1[1] . . . which, at first glance, I took as an
enhancement due to its smoothing effect, but I don't really think you
intended it that way (but hey, if it works . . . use it!).

Bob Hunt

----------------------------------

inputs: FastMA(12),SlowMA(26),MacdMA(9);


value1=MACD(Close,FastMA,SlowMA)-(XAverage(MACD(Close,FastMA,SlowMA),MacdMA));

plot1(0,"MA up"); {green hist}{this is really nice, thanks for the
insight}
plot2(0,"MA dn"); {red hist}

if value1>value1[1] then begin
        plot1(value1,"MA up");
        end else begin
        plot2(value1,"MA dn");
end;

Plot3(MACD(Close,FastMA,SlowMA),"MACD");                       {green
line}
Plot4(XAverage(MACD(Close,FastMA,SlowMA),MacdMA),"MACDAvg");    {red
line}