Hello everyone,
I was wondering if someone can please help me with this code. What I'm trying to achieve is for a histogram plot of only volume bars that are above average volume. Here is what I came up with, but nothing plots. I'm very new to this, so any help would be much appreciated. Thanks.
I was wondering if someone can please help me with this code. What I'm trying to achieve is for a histogram plot of only volume bars that are above average volume. Here is what I came up with, but nothing plots. I'm very new to this, so any help would be much appreciated. Thanks.
Code:
declare lower;
declare zerobase;
input length = 50;
plot Vol = volume;
plot VolAvg = Average(volume, length);
plot AboveAvgVol = Vol>VolAvg;
AboveAvgVol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
AboveAvgVol.SetLineWeight(3);
AboveAvgVol.DefineColor("Up", Color.UPTICK);
AboveAvgVol.DefineColor("Down", Color.DOWNTICK);
AboveAvgVol.AssignValueColor(if close > close[1] then Vol.color("Up") else if close < close[1] then AboveAvgVol.color("Down") else GetColor(1));
VolAvg.SetDefaultColor(GetColor(8));