|
NY, NY
Posts: 68 since Dec 2011
Thanks Given: 27
Thanks Received: 19
|
I'm having trouble trying to programmatically change a default color setting to the desired custom setting for the
ElderImpulse indicator as highlighted below. I even tried changing the color in the "Edit Properties" GUI interface
with no luck...
Any help/assistance would be greatly appreciated. Thanks in advance...
# Indicator name: ElderImpulse
input length = 13;
input paintBars = yes;
def EMA = ExpAverage(close, length);
def MACD = ExpAverage(close, 12) - ExpAverage(close, 26);
def MACDHist = MACD - ExpAverage(MACD, 9);
def GreenPrice = EMA > EMA[1] and MACDHist > MACDHist[1];
def RedPrice = EMA < EMA[1] and MACDHist < MACDHist[1];
plot Bullish = GreenPrice;
plot Neutral = !GreenPrice and !RedPrice;
plot Bearish = RedPrice;
Bullish.SetDefaultColor(Color.UPTICK);
Bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Bullish.SetLineWeight(3);
Bullish.Hide();
Neutral.SetDefaultColor(Color.BLUE);
#Neutral.SetDefaultColor(CreateColor(204, 204, 0));
Neutral.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Neutral.SetLineWeight(3);
Neutral.Hide();
Bearish.SetDefaultColor(Color.DOWNTICK);
Bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Bearish.SetLineWeight(3);
Bearish.Hide();
DefineGlobalColor("Bullish", Color.UPTICK);
DefineGlobalColor("Neutral", Color.BLUE);
#DefineGlobalColor("Neutral", CreateColor(204, 204, 0));
DefineGlobalColor("Bearish", Color.DOWNTICK);
AssignPriceColor(if !paintBars then Color.CURRENT
else
if GreenPrice then GlobalColor("Bullish")
else
if RedPrice then GlobalColor("Bearish")
else GlobalColor("Neutral"));
|