I've got the following code where I'm trying to paint histogram bars on a gradient with a low average magenta and a high average cyan, but the bars aren't painting the right color. They just paint cyan and I'm honestly not sure where it's getting cyan because if I change dynamic colors away from cyan and magenta the bars still paint cyan.
If I comment out the SumTick.hide(); line I can see that SumTick is using the correct colors, but for TL and TH the plot doesn't seem to be pulling the colors correctly and using them.
Any suggestions?
If I comment out the SumTick.hide(); line I can see that SumTick is using the correct colors, but for TL and TH the plot doesn't seem to be pulling the colors correctly and using them.
Any suggestions?
Code:
declare lower;
plot SumTick = (close("$TICK") + high("$TICK") + low("$TICK")) /3;
SumTick.AssignNormGradientColor(14, Color.MAGENTA, color.CYAN);
SumTick.hide();
def TickHigh = high("$TICK");
def TickLow = low("$TICK");
def TickDiff;
if TickHigh > 0 and TickLow > 0 {
TickDiff = TickLow;
} else if TickHigh < 0 and TickLow < 0 {
TickDiff = TickHigh;
} else {
TickDiff = 0;
}
plot ZL = 0;
ZL.AssignValueColor(color.GRAY);
plot ZLfill = 0;
ZLfill.AssignValueColor(if TickDiff != 0 then color.BLACK else color.ORANGE);
ZLfill.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
plot TD = TickDiff;
TD.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
TD.SetDefaultColor(color.BLACK);
plot TH = TickHigh;
TH.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
TH.AssignValueColor(SumTick.TakeValueColor());
plot TL = TickLow;
TL.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
TL.AssignValueColor(SumTick.TakeValueColor());