does anybody know how to code this?
I want to get the difference of the tallest "Up and Positive" candle or the tallest Yellowgreen candle and the tallest inverted bright red candle.
This is from the MACD difference. How do I code this to find the tallest yellowgreen candle and subtract it to the tallest bright red candle?
I want to get the difference of the tallest "Up and Positive" candle or the tallest Yellowgreen candle and the tallest inverted bright red candle.
This is from the MACD difference. How do I code this to find the tallest yellowgreen candle and subtract it to the tallest bright red candle?
Ruby:
#
# TD Ameritrade IP Company, Inc. (c) 2007-2024
#
declare lower;
input fastLength = 12;
input slowLength = 26;
input MACDLength = 9;
input averageType = AverageType.EXPONENTIAL;
input showBreakoutSignals = no;
plot Diff = MACD(fastLength, slowLength, MACDLength, averageType).Diff;
Diff.SetDefaultColor(GetColor(5));
Diff.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Diff.SetLineWeight(3);
Diff.DefineColor("Positive and Up", Color.GREEN);
Diff.DefineColor("Positive and Down", Color.DARK_GREEN);
Diff.DefineColor("Negative and Down", Color.RED);
Diff.DefineColor("Negative and Up", Color.DARK_RED);
Diff.AssignValueColor(if Diff >= 0 then if Diff > Diff[1] then Diff.color("Positive and Up") else Diff.color("Positive and Down") else if Diff < Diff[1] then Diff.color("Negative and Down") else Diff.color("Negative and Up"));