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

Color on Histogram



PureBytes Links

Trading Reference Links

Someone posted code to change the colors on a histogram to one color when
the bars are rising and another color when the bars are falling, but I
failed to keep the post and can't find it in the Omega List archives. I'm
re-writing the MACD indicator included in TS to show "green" when MADiff is
rising and red when falling. What I've done so far works most of the time
except when the bar starts up and then turns down on the same bar, or vice
versa, then I get both colors on the intraday bar:

Input: FastMA(12),SlowMA(26),MacdMA(9);
Vars: BullKeyReversal(FALSE), BearKeyReversal(FALSE),
LTHighestUnder(FALSE), LTLowestUnder(FALSE), LongTermTrendUnder(0),
ShortTermTrendUnder(0), LongTermTrendIndic(0), ShortTermTrendIndic(0),
nocommentary(FALSE), ShortTermDays(0), LongTermDays(0), LTAvgUnd(0),
STAvgUnd(0), LTAvgInd(0), STAvgInd(0), String1("");

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");

I can format MAup to plot green, and MAdn to red, but how do I keep the
colors from overlapping?