Cwparker23
Member
I created this indicator after reading Anna Coulling book on volume price analysis. https://www.amazon.com/Complete-Gui...t=&hvlocphy=9051671&hvtargid=pla-432422856366
The indicator finds irregular bodies based on candle size and volume it colors price to indicate irregular bodies below volume average (blue bullish and plum bearish) and indicate bodies above-average volume (cyan bullish ad magenta bearish). Also colors price with above-average volume (green bullish and red bearish) and below-average volume (light green bullish and orange bearish).
Here is the link to the indicator: https://tos.mx/uSOXiHe Click here for --> Easiest way to load shared links
Ruby:
# Anna Coulling Volume Price Analysis For ThinkOrSwim
# Original script by Cwparker23
AddLabel(yes, "Day_volume: " + volume (period = "DAY" ), Color.LIGHT_GRAY);
AddLabel(yes, "volume: " + volume, Color.white);
declare lower;
declare zerobase;
plot Vol = volume;
plot VolAvg = expAverage(volume);
VolAvg .SetPaintingStrategy(PaintingStrategy.squared_HISTOGRAM);
VolAvg .SetDefaultColor(Color.GRAY);
def BODY_RANGE = max(oPEN,cLOSE) - min(oPEN,cLOSE);
plot IR_BODY = if BODY_RANGE < BODY_RANGE[1] and volume > volume[1] then 1 else 0 ;
def IR_BODYG = if IR_BODY and close>open then 1 else 0;
def IR_BODYR = if IR_BODY and close<open then 1 else 0;
Vol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Vol.SetLineWeight(3);
Vol.DefineColor("Up", Color.green);
Vol.DefineColor("Down", Color.red);
Vol.DefineColor("Up2", Color.light_green);
Vol.DefineColor("Down2", Color.dark_ORANGE );
Vol.DefineColor("Up3", Color.cyan);
Vol.DefineColor("Up4", Color.blue);
Vol.DefineColor("Down3", Color.mAGENTA );
Vol.DefineColor("Down4", Color.plum );
Vol.AssignValueColor(
if close > open and IR_BODYG and Vol >VolAvg then Vol.color("Up3") else if
close > open and IR_BODYG then Vol.color("Up4")
else if close < open and IR_BODYR and Vol >VolAvg then Vol.color("Down3")
else if close < open and IR_BODYR then Vol.color("Down4")
else if close > open and Vol >VolAvg then Vol.color("Up")
else if close < open and Vol >VolAvg then Vol.color("Down")
else if close > open then Vol.color("Up2")
else if close < open then Vol.color("Down2")
else GetColor(1));
input paintBars = yes;
DefineGlobalColor("CAM_UP", Color.GREEN);
DefineGlobalColor("CAM_UP2", Color.liGHT_GREEN);
DefineGlobalColor("CAM_UP3", Color.cyan);
DefineGlobalColor("CAM_UP4", Color.blue);
DefineGlobalColor("CAM_DN", Color.RED);
DefineGlobalColor("CAM_DN2", Color.darK_ORANGE );
DefineGlobalColor("CAM_DN3", Color.mAGENTA );
DefineGlobalColor("CAM_DN4", Color.plum );
AssignPriceColor(if !paintBars then Color.CURRENT
else if close > open and IR_BODYG and Vol >VolAvg then GlobalColor("CAM_UP3")
else if close < open and IR_BODYR and Vol >VolAvg then GlobalColor("CAM_DN3")
else if close > open and IR_BODYG then GlobalColor("CAM_UP4")
else if close < open and IR_BODYR then GlobalColor("CAM_DN4")
else if close > open and Vol >VolAvg then GlobalColor("CAM_UP")
else if close < open and Vol >VolAvg then GlobalColor("CAM_DN")
else if close > open then GlobalColor("CAM_UP2")
else if close < open then GlobalColor("CAM_DN2")
else Color.CURRENT);
Last edited by a moderator: