I’m looking to color volume bars based on variable thresholds (for example if volume>400k then color orange, if > 1M then color pink, etc). Is there a way to do this with the built in volume indicator or can it be created in pro-builder code? I’ve tried my own take at it using something similar to the excerpt below but it is only showing regular trading hours volume. During pre and post market there are no volume bars.
IF close > open AND Volume > q THEN
upvoln = 0
upvolm = 0
upvolo = 0
upvolp = 0
upvolq = Volume
downvoln = 0
downvolm = 0
downvolo = 0
downvolp = 0
downvolq = 0
ELSIF close > open AND Volume > p THEN
upvoln = 0
upvolm = 0
upvolo = 0
upvolp = Volume
upvolq = 0
downvoln = 0
downvolm = 0
downvolo = 0
downvolp = 0
downvolq = 0
Aquí tienes un ejemplo:
q=400000
p=1000000
if volume>q and close>open then
r=0
g=255
b=0
elsif close>open then
r=0
g=255
b=255
elsif close<open and volume>p then
r=255
g=0
b=0
elsif close<open then
r=255
g=0
b=255
else
r=124
g=124
b=124
endif
return volume style(histogram)coloured(r,g,b)