Hello Hahn,
I was wondering if you can help me set up candle colors based on the following conditions being met of the two oscillators.
- When the Awesome Oscillator and AccelerationDecelerationOsc histogram are green then candle is green.
- When the Awesome Oscillator and AccelerationDecelerationOsc histogram are red then candle is Red.
- When the Awesome Oscillator and AccelerationDecelerationOsc histogram are mismatched then candle is yellow.
Thank you so much Hahn. Hope all is well. Here is the code below.
Awesome Oscillator:
#
# TD Ameritrade IP Company, Inc. (c) 2007-2019
#
declare lower;
declare zerobase;
plot AO = Average(hl2, 5) – Average(hl2, 34);
plot Zero = 0;
AO.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
AO.SetLineWeight(3);
AO.DefineColor(“Up”, Color.UPTICK);
AO.DefineColor(“Down”, Color.DOWNTICK);
AO.AssignValueColor(if AO > AO[1] then AO.color(“Up”) else if AO < AO[1] then AO.color(“Down”) else GetColor(1));
Zero.SetDefaultColor(GetColor(5));
AccelerationDecelerationOsc
#
# TD Ameritrade IP Company, Inc. (c) 2010-2019
#
declare lower;
def AO = AwesomeOscillator();
plot AC = AO – Average(AO, 5);
plot ZeroLine = 0;
AC.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
AC.SetLineWeight(3);
AC.DefineColor(“Up”, Color.UPTICK);
AC.DefineColor(“Down”, Color.DOWNTICK);
AC.AssignValueColor(if AC > AC[1] then AC.color(“Up”) else if AC < AC[1] then AC.color(“Down”) else GetColor(1));
ZeroLine.SetDefaultColor(GetColor(5));
Like this:
Like Loading...