I tweaked some basic code from an old RCB enhanced volume study that I've had for a while. I layer two of these volume studies on the chart, one showing any volume that hits 3 SD's and another showing 1 standard deviation (below). In addition to the volume bars changing colors based on the study, I'd like to have the price candles repaint to match the volume bars. Any help would be awesome! Cheers
https://usethinkscript.com/threads/thinkorswim-indicators-for-basic-fundamental-analysis.866/
#Chris' Enhanced Volume
###############
# Body
###############
input Audible_Alert = yes;
def Deviation_Length = 60;
def Deviate = 1;
def volumestdev = RelativeVolumeStDev(length = Deviation_Length);
def abovedev = volumestdev >= Deviate;
def belowdev = volumestdev <= Deviate;
###############
# Volume Bars
###############
plot volumereplace = volume;
volumereplace.SetPaintingStrategy(paintingStrategy = PaintingStrategy.HISTOGRAM);
def increase = volume > volume[1];
def devincrease = increase and abovedev;
def decrease = volume < volume[1];
def devdecrease = decrease and abovedev;
volumereplace.DefineColor("Increase", Color.DARK_GREEN);
volumereplace.DefineColor("DevIncrease", Color.GREEN);
volumereplace.DefineColor("Decrease", Color.DARK_RED);
volumereplace.DefineColor("DevDecrease", Color.LIGHT_RED);
volumereplace.AssignValueColor(
if devincrease then volumereplace.Color("DevIncrease")
else
if increase then volumereplace.Color("Increase")
else
if devdecrease then volumereplace.Color("DevDecrease")
else
volumereplace.Color("Decrease"));