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

Re: Color on Histogram


  • To: omega-list@xxxxxxxxxx>
  • Subject: Re: Color on Histogram
  • From: Dennis Holverstott <dennis@xxxxxxxxxx>
  • Date: Wed, 4 Nov 1998 17:57:54 -0500 (EST)
  • In-reply-to: <19981104193003196.AAA140@xxxxxxxxxxxxxxxxxxx@notebook>

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