MetaStock™ Zone Tworzenie Sytemów Trader Shop Forum & FAQ Artykuły Linki Elliott Waves EasyLanguage™ Zone

 

Color on MACD Histogram I
Color on Histogram

· To: omega-list@xxxxxxxxxx
· Subject: Color on 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 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:


Type : Indicator, Name : Color on 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");

 

t-i-Color_on_MACD_Histogram.gif

 

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

[14461]

Source / From: TOP
http://www.purebytes.com

Equis and MetaStock® and MetaStock Professional® are registered trademarks of Equis International. Achelis Binary Wave®, The DownLoader®,
Expert Advisor®, OptionScope®, Quotecenter® and Smart Charts® are trademarks of Equis International, a Thomson Reuters company.

TradeStation® Pro, TradeStation® 2000i, OptionStation®, SuperCharts®, PowerEditor® and EasyLanguage®
are registered trademarks of TradeStation Technologies, Inc. Other names and marks referred to are the property of their respective owners.

All information provided on this website is for educational purposes only. Trading involves risk, including possible loss of principal and other losses.

Ten i inne materiały na tej stronie zostały zamieszczone zostały jedynie w celach edukacyjnych, nie ponoszę żadnej odpowiedzialno¶ci za ich stosowanie.

Gra na giełdzie niesie ze sob± ryzyko poważnych strat finansowych!