Автор:
Разместил:   Дата: 2005-12-27 16:34
Комментарии: (0)   Рейтинг:

Color on MACD Histogram I

Color o­n Histogram

· To: omega-list@xxxxxxxxxx
· Subject: Color o­n Histogram
· From: ribau@xxxxxxxxxxxxx
· Date: Wed, 04 Nov 1998 00:20:51 GMT
· Resent-Date: Tue, 3 Nov 1998 16:22:09 -0800
· Resent-From: omega-list@xxxxxxxxxx
· Resent-Message-ID: <"6juXh2.0.ye4.nuvFs";@mx1>
· Resent-Sender: omega-list-request@xxxxxxxxxx

Someone posted code to change the colors o­n a histogram to o­ne 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 o­n the same bar, or vice versa, then I get both colors o­n the intraday bar:

Type : Indicator, Name : Color o­n MACD Histogram

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?



 
Реклама:

Rambler's Top100

Страница создана за 0.043 секунды