PureBytes Links
Trading Reference Links
|
Yes this works well on EOD data. Different spin. I do not work with
interday
data...I am sure others do. However you can streamline you code a
little, I am
sure others will give you more pointers.
{indicator MACD\Rise\Fall same results as TS MACD
with variation-- colour 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"){ Blue Histogram}
Else Plot4(Value1,"MAdn"); {Red Historgram}
Good Trading
John
ribau@xxxxxxxxxxxxx wrote:
> 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?
|