Better Volume Indicator for ThinkorSwim

After much research, I conclude there is no syntax that will give CONSISTENT results when creating alerts.
The recursive definitions of high/lows will result in random albeit occasionally true results.
Hi there, I would appreciate it very much if you would tell me what the default color (teal color) represents? Also, how to interpret the a fully colored in candle vs. the ones that aren't?
 
my trading method has changed and I do not want to steer anybody wrong or making continuous annoying posts.
https://usethinkscript.com/threads/...n-and-average-for-thinkorswim.853/#post-93963


Here is the code. Remember the "smart money" control the markets.
declare lower;

# BetterVolume
# Adapted from the BetterVolume Indicator:
# http://emini-watch.com/free-stuff/volume-indicator/
# By
# http://thinkscripter.wordpress.com
# thinkscripter@...
# Last Update 19 APR 2009


# 7/25/2010 Re-written to include:
# - user selectable volume color bars
# - the option to turn price color bars off
# - there is no min v/r function in this study (formerly painted as a Climax Down bar)
# See forum thread discussion for important information about the study

# 8/2/2010 'Magenta toxicity' is now absent.
# 8/3/2010:
# The previous versions had the possibility of painting HighVolumeChurn bars when the
# condition was also a low volume condition. In this study low volume takes precedence.
# 8/4/2010: rev 3: Well the above didn't fix the low volume/high volume churn as I had expected.
# This fix should.
# 8/4/2010 Replaced Simple MA on Volume with Wilders Average (2 period)
# 8/5/2010 Added Price Volatility Spike Color Bar

#declare on_volume;
declare real_size;


input MA_Period = 10;
input LookBack = 10;
input ShowColorOnPrice = Yes;
def closeLog = Log(close[1] / close[2]);
def SDeva = StDev(closeLog, LookBack) * Sqrt(LookBack / (LookBack - 1));
def m = SDeva * close[1];
def spike = (close[0] - close[1]) / m;


def PriceColor = ShowColorOnPrice && volume;
def Range = high - low;
def VxR = volume * Range;
def VperR = if Range <> 0 then volume / Range else 0;
def LowVolume = volume == Lowest(volume, LookBack);
def ClimaxUp = VxR == Highest(VxR, LookBack) && close > open && !LowVolume;
def ClimaxDn = VxR == Highest(VxR, LookBack) && close < open && !LowVolume;
def HighVolumeChurn = VperR == Highest(VperR, LookBack) && !LowVolume;
def ClimaxChurn = (ClimaxUp or ClimaxDn) && HighVolumeChurn;

plot BetterVolume = volume;
BetterVolume.DefineColor("ClimaxUpColor", Color.RED);
BetterVolume.DefineColor("ClimaxDnColor", Color.WHITE);
BetterVolume.DefineColor("HighVolumeChurnColor", CreateColor(51, 102, 255));
BetterVolume.DefineColor("LowVolumeColor", Color.YELLOW);
BetterVolume.DefineColor("ClimaxChurnColor", Color.MAGENTA);
BetterVolume.DefineColor("DefaultColor", CreateColor(51, 51, 51));
BetterVolume.DefineColor("PriceChurnColor", Color.LIGHT_GREEN);
BetterVolume.DefineColor("SpikeColor", Color.CYAN);

#plot AverageVolume = Average(volume, MA_Period);
#AverageVolume.SetDefaultColor(color.red);
plot WilderAveVol = WildersAverage(volume, 2);
WilderAveVol.SetDefaultColor(CreateColor(128, 128, 128));

BetterVolume.AssignValueColor ( if ClimaxChurn then BetterVolume.Color("ClimaxChurnColor") else
if ClimaxUp then BetterVolume.Color("ClimaxUpColor") else
if ClimaxDn then BetterVolume.Color("ClimaxDnColor") else
if HighVolumeChurn then BetterVolume.Color("HighVolumeChurnColor") else
if LowVolume then BetterVolume.Color("LowVolumeColor")
else BetterVolume.Color("DefaultColor"));

BetterVolume.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
BetterVolume.SetLineWeight(5);

AssignPriceColor( if spike > 3.0 or spike < -3.0 then BetterVolume.Color("SpikeColor") else if ClimaxChurn && PriceColor then BetterVolume.Color("ClimaxChurnColor") else
if ClimaxUp && PriceColor then BetterVolume.Color("ClimaxUpColor") else
if ClimaxDn && PriceColor then BetterVolume.Color("ClimaxDnColor") else
if HighVolumeChurn && PriceColor then BetterVolume.Color("PriceChurnColor") else
if LowVolume && PriceColor then BetterVolume.Color("LowVolumeColor") else
if PriceColor then BetterVolume.Color("DefaultColor") else
Color.CURRENT);

#
# *************************************************************
# INDICATOR'S COLOR LEGEND
# *************************************************************
AddLabel(yes, "Amateur Trading", BetterVolume.Color("LowVolumeColor"));
AddLabel(yes, "Smart Money Volume Churn", BetterVolume.Color("HighVolumeChurnColor"));
AddLabel(yes, "Smart Money Price Churn", BetterVolume.Color("PriceChurnColor"));
AddLabel(yes, "Climax Down", BetterVolume.Color("ClimaxDnColor"));
AddLabel(yes, "Climax Up", BetterVolume.Color("ClimaxUpColor"));
AddLabel(yes, "Climax Churn", BetterVolume.Color("ClimaxChurnColor"));
AddLabel(yes, "Smart Money Spike", BetterVolume.Color("SpikeColor"));
AddLabel(yes, "Normal", BetterVolume.Color("DefaultColor"));


Hope you understand everything and good luck trading. Feel free to ask any questions you like!
Thanks for your time. --Keith
 
Last edited by a moderator:
I was able to find this my studies collection
Better Momentum


Code:
#
#Better Volume for Thinkorswim
#
#
#hint: Verbatim translation of the TradeStation code from http://emini-watch.com/free-stuff/volume-indicator/
#==========================================================================

#DECLARATIONS
#==========================================================================
declare on_volume;
declare real_size;

#INPUTS
#==========================================================================
input iShowLowVol      = YES;
input iShowClimaxUp    = YES;
input iShowClimaxDown  = YES;
input iShowChurn       = YES;
input iShowClimaxChurn = YES;

input iUseTwoBars = {default "YES", "NO"};
input iLookback   = 20;

#VARS
#==========================================================================
def vValue1;
def vValue2;
def vValue3;
def vValue4;
def vValue5;
def vValue6;
def vValue7;
def vValue8;
def vValue9;
def vValue10;
def vValue11;
def vValue12;
def vValue13;
def vValue14;
def vValue15;
def vValue16;
def vValue17;
def vValue18;
def vValue19;
def vValue20;
def vValue21;
def vValue22;

def vCondition1;
def vCondition2;
def vCondition3;
def vCondition4;
def vCondition5;
def vCondition6;
def vCondition7;
def vCondition8;
def vCondition9;
def vCondition10;
def vCondition11;
def vCondition12;
def vCondition13;
def vCondition14;
def vCondition15;
def vCondition16;
def vCondition17;
def vCondition18;
def vCondition19;
def vCondition20;

def vRange;

#LOGIC
#==========================================================================
vRange = high - low;

if close > open and vRange <> 0
    then {vValue1 = (vRange/(2*vRange + open - close))*volume;
          vValue2 = volume - vValue1;}
else if close < open and vRange <> 0
    then {vValue1 = ((vRange + close - open)/(2*vRange + close - open))*volume;
          vValue2 = volume - vValue1;}
else if close == open
    then {vValue1 = 0.5*volume;
          vValue2 = volume - vValue1;}
    else {vValue1 = 0;
          vValue2 = 0;}

vValue3 = AbsValue(vValue1 + vValue2);
vValue4 = vValue1*vRange;
vValue5 = (vValue1 - vValue2)*vRange;
vValue6 = vValue2*vRange;
vValue7 = (vValue2 - vValue1)*vRange;

if vRange <> 0
    then {vValue8  = vValue1/vRange;
          vValue9  = (vValue1 - vValue2)/vRange;
          vValue10 = vValue2/vRange;
          vValue11 = (vValue2 - vValue1)/vRange;
          vValue12 = vValue3/vRange;}
    else {vValue8  = 0;
          vValue9  = 0;
          vValue10 = 0;
          vValue11 = 0;
          vValue12 = 0;}

switch(iUseTwoBars)
{
    case "YES":
        vValue13 = vValue3 + vValue3[1];
        vValue14 = (vValue1 + vValue1[1])*(Highest(high,2) - Lowest(low,2));
        vValue15 = (vValue1 + vValue1[1] - vValue2 - vValue2[1])*(Highest(high,2) - Lowest(low,2));
        vValue16 = (vValue2 + vValue2[1])*(Highest(high,2) - Lowest(low,2));
        vValue17 = (vValue2 + vValue2[1] - vValue1 - vValue1[1])*(Highest(high,2) - Lowest(low,2));
  
        if Highest(high,2) <> Lowest(low,2)
            then {vValue18 = (vValue1 + vValue1[1])/(Highest(high,2) - Lowest(low,2));
                  vValue19 = (vValue1 + vValue1[1] - vValue2 - vValue2[1])/(Highest(high,2) - Lowest(low,2));
                  vValue20 = (vValue2 + vValue2[1])/(Highest(high,2) - Lowest(low,2));
                  vValue21 = (vValue2 + vValue2[1] - vValue1 - vValue1[1])/(Highest(high,2) - Lowest(low,2));
                  vValue22 = vValue13/(Highest(high,2) - Lowest(low,2));}
            else {vValue18 = 0;
                  vValue19 = 0;
                  vValue20 = 0;
                  vValue21 = 0;
                  vValue22 = 0;}
  
        vCondition1  = 0;
        vCondition2  = 0;
        vCondition3  = 0;
        vCondition4  = 0;
        vCondition5  = 0;
        vCondition6  = 0;
        vCondition7  = 0;
        vCondition8  = 0;
        vCondition9  = 0;
        vCondition10 = 0;
        vCondition11 = vValue13 == Lowest(vValue13, iLookback);
        vCondition12 = vValue14 == Highest(vValue14, iLookback) and close > open and close[1] > open[1];
        vCondition13 = vValue15 == Highest(vValue15, iLookback) and close > open and close[1] > open[1];
        vCondition14 = vValue16 == Highest(vValue16, iLookback) and close < open and close[1] < open[1];
        vCondition15 = vValue17 == Highest(vValue17, iLookback) and close < open and close[1] < open[1];
        vCondition16 = vValue18 == Lowest(vValue18, iLookback)  and close < open and close[1] < open[1];
        vCondition17 = vValue19 == Lowest(vValue19, iLookback)  and close < open and close[1] < open[1];
        vCondition18 = vValue20 == Lowest(vValue20, iLookback)  and close > open and close[1] > open[1];
        vCondition19 = vValue21 == Lowest(vValue21, iLookback)  and close > open and close[1] > open[1];
        vCondition20 = vValue22 == Highest(vValue22, iLookback);
  
    case "NO":
        vValue13 = 0;
        vValue14 = 0;
        vValue15 = 0;
        vValue16 = 0;
        vValue17 = 0;
        vValue18 = 0;
        vValue19 = 0;
        vValue20 = 0;
        vValue21 = 0;
        vValue22 = 0;
  
        vCondition1  = vValue3  == Lowest(vValue3, iLookback);
        vCondition2  = vValue4  == Highest(vValue4, iLookback) and close > open;
        vCondition3  = vValue5  == Highest(vValue5, iLookback) and close > open;
        vCondition4  = vValue6  == Highest(vValue6, iLookback) and close < open;
        vCondition5  = vValue7  == Highest(vValue7, iLookback) and close < open;
        vCondition6  = vValue8  == Lowest(vValue8, iLookback)  and close < open;
        vCondition7  = vValue9  == Lowest(vValue9, iLookback)  and close < open;
        vCondition8  = vValue10 == Lowest(vValue10, iLookback) and close > open;
        vCondition9  = vValue11 == Lowest(vValue11, iLookback) and close > open;
        vCondition10 = vValue12 == Highest(vValue12, iLookback);
        vCondition11 = 0;
        vCondition12 = 0;
        vCondition13 = 0;
        vCondition14 = 0;
        vCondition15 = 0;
        vCondition16 = 0;
        vCondition17 = 0;
        vCondition18 = 0;
        vCondition19 = 0;
        vCondition20 = 0;
}

#PLOTS
#==========================================================================
plot pBetterVolume = volume;

#PLOT STYLES & SETTINGS
#==========================================================================
pBetterVolume.DefineColor("LowVol",      Color.YELLOW);
pBetterVolume.DefineColor("ClimaxUp",    Color.RED);
pBetterVolume.DefineColor("ClimaxDown",  Color.WHITE);
pBetterVolume.DefineColor("Churn",       Color.BLUE);
pBetterVolume.DefineColor("ClimaxChurn", Color.MAGENTA);
pBetterVolume.DefineColor("Default",     Color.BLACK);

pBetterVolume.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

pBetterVolume.AssignValueColor
(
         if iShowLowVol      and (vCondition1 or vCondition11)  then pBetterVolume.Color("LowVol")
    else if iShowClimaxUp    and (vCondition2 or vCondition3 or vCondition8 or vCondition9 or vCondition12
                                  or vCondition13 or vCondition18 or vCondition19)
                                                                  then pBetterVolume.Color("ClimaxUp")
    else if iShowClimaxDown  and (vCondition4 or vCondition5 or vCondition6 or vCondition7 or vCondition14
                                  or vCondition15 or vCondition16 or vCondition17)
                                                                  then pBetterVolume.Color("ClimaxDown")
    else if iShowChurn       and (vCondition10 or vCondition20) then pBetterVolume.Color("Churn")
    else if iShowClimaxChurn and (vCondition10 or vCondition20)
                             and (vCondition2 or vCondition3 or vCondition4 or vCondition5 or vCondition6
                                  or vCondition7 or vCondition8 or vCondition9 or vCondition12
                                  or vCondition13 or vCondition14 or vCondition15 or vCondition16
                                  or vCondition17 or vCondition18 or vCondition19)
                                                                  then pBetterVolume.Color("ClimaxChurn")
    else pBetterVolume.Color("Default")
);

AssignPriceColor
(
         if iShowLowVol      and (vCondition1 or vCondition11)  then pBetterVolume.Color("LowVol")
    else if iShowClimaxUp    and (vCondition2 or vCondition3 or vCondition8 or vCondition9 or vCondition12
                                  or vCondition13 or vCondition18 or vCondition19)
                                                                  then pBetterVolume.Color("ClimaxUp")
    else if iShowClimaxDown  and (vCondition4 or vCondition5 or vCondition6 or vCondition7 or vCondition14
                                  or vCondition15 or vCondition16 or vCondition17)
                                                                  then pBetterVolume.Color("ClimaxDown")
    else if iShowChurn       and (vCondition10 or vCondition20) then pBetterVolume.Color("Churn")
    else if iShowClimaxChurn and (vCondition10 or vCondition20)
                             and (vCondition2 or vCondition3 or vCondition4 or vCondition5 or vCondition6
                                  or vCondition7 or vCondition8 or vCondition9 or vCondition12
                                  or vCondition13 or vCondition14 or vCondition15 or vCondition16
                                  or vCondition17 or vCondition18 or vCondition19)
                                                                  then pBetterVolume.Color("ClimaxChurn")
    else pBetterVolume.Color("Default")
);
 
Last edited by a moderator:
my trading method has changed and I do not want to steer anybody wrong or making continuous annoying posts.
https://usethinkscript.com/threads/...n-and-average-for-thinkorswim.853/#post-93963


Here is the code. Remember the "smart money" control the markets.
declare lower;

# BetterVolume
# Adapted from the BetterVolume Indicator:
# http://emini-watch.com/free-stuff/volume-indicator/
# By
# http://thinkscripter.wordpress.com
# thinkscripter@...
# Last Update 19 APR 2009


# 7/25/2010 Re-written to include:
# - user selectable volume color bars
# - the option to turn price color bars off
# - there is no min v/r function in this study (formerly painted as a Climax Down bar)
# See forum thread discussion for important information about the study

# 8/2/2010 'Magenta toxicity' is now absent.
# 8/3/2010:
# The previous versions had the possibility of painting HighVolumeChurn bars when the
# condition was also a low volume condition. In this study low volume takes precedence.
# 8/4/2010: rev 3: Well the above didn't fix the low volume/high volume churn as I had expected.
# This fix should.
# 8/4/2010 Replaced Simple MA on Volume with Wilders Average (2 period)
# 8/5/2010 Added Price Volatility Spike Color Bar

#declare on_volume;
declare real_size;


input MA_Period = 10;
input LookBack = 10;
input ShowColorOnPrice = Yes;
def closeLog = Log(close[1] / close[2]);
def SDeva = StDev(closeLog, LookBack) * Sqrt(LookBack / (LookBack - 1));
def m = SDeva * close[1];
def spike = (close[0] - close[1]) / m;


def PriceColor = ShowColorOnPrice && volume;
def Range = high - low;
def VxR = volume * Range;
def VperR = if Range <> 0 then volume / Range else 0;
def LowVolume = volume == Lowest(volume, LookBack);
def ClimaxUp = VxR == Highest(VxR, LookBack) && close > open && !LowVolume;
def ClimaxDn = VxR == Highest(VxR, LookBack) && close < open && !LowVolume;
def HighVolumeChurn = VperR == Highest(VperR, LookBack) && !LowVolume;
def ClimaxChurn = (ClimaxUp or ClimaxDn) && HighVolumeChurn;

plot BetterVolume = volume;
BetterVolume.DefineColor("ClimaxUpColor", Color.RED);
BetterVolume.DefineColor("ClimaxDnColor", Color.WHITE);
BetterVolume.DefineColor("HighVolumeChurnColor", CreateColor(51, 102, 255));
BetterVolume.DefineColor("LowVolumeColor", Color.YELLOW);
BetterVolume.DefineColor("ClimaxChurnColor", Color.MAGENTA);
BetterVolume.DefineColor("DefaultColor", CreateColor(51, 51, 51));
BetterVolume.DefineColor("PriceChurnColor", Color.LIGHT_GREEN);
BetterVolume.DefineColor("SpikeColor", Color.CYAN);

#plot AverageVolume = Average(volume, MA_Period);
#AverageVolume.SetDefaultColor(color.red);
plot WilderAveVol = WildersAverage(volume, 2);
WilderAveVol.SetDefaultColor(CreateColor(128, 128, 128));

BetterVolume.AssignValueColor ( if ClimaxChurn then BetterVolume.Color("ClimaxChurnColor") else
if ClimaxUp then BetterVolume.Color("ClimaxUpColor") else
if ClimaxDn then BetterVolume.Color("ClimaxDnColor") else
if HighVolumeChurn then BetterVolume.Color("HighVolumeChurnColor") else
if LowVolume then BetterVolume.Color("LowVolumeColor")
else BetterVolume.Color("DefaultColor"));

BetterVolume.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
BetterVolume.SetLineWeight(5);

AssignPriceColor( if spike > 3.0 or spike < -3.0 then BetterVolume.Color("SpikeColor") else if ClimaxChurn && PriceColor then BetterVolume.Color("ClimaxChurnColor") else
if ClimaxUp && PriceColor then BetterVolume.Color("ClimaxUpColor") else
if ClimaxDn && PriceColor then BetterVolume.Color("ClimaxDnColor") else
if HighVolumeChurn && PriceColor then BetterVolume.Color("PriceChurnColor") else
if LowVolume && PriceColor then BetterVolume.Color("LowVolumeColor") else
if PriceColor then BetterVolume.Color("DefaultColor") else
Color.CURRENT);

#
# *************************************************************
# INDICATOR'S COLOR LEGEND
# *************************************************************
AddLabel(yes, "Amateur Trading", BetterVolume.Color("LowVolumeColor"));
AddLabel(yes, "Smart Money Volume Churn", BetterVolume.Color("HighVolumeChurnColor"));
AddLabel(yes, "Smart Money Price Churn", BetterVolume.Color("PriceChurnColor"));
AddLabel(yes, "Climax Down", BetterVolume.Color("ClimaxDnColor"));
AddLabel(yes, "Climax Up", BetterVolume.Color("ClimaxUpColor"));
AddLabel(yes, "Climax Churn", BetterVolume.Color("ClimaxChurnColor"));
AddLabel(yes, "Smart Money Spike", BetterVolume.Color("SpikeColor"));
AddLabel(yes, "Normal", BetterVolume.Color("DefaultColor"));


Hope you understand everything and good luck trading. Feel free to ask any questions you like!
Thanks for your time. --Keith

interesting study @brook0010 !

particularly because i actively use BETTER_VOLUME in my trading.

may i pick your brain - what do SMART MONEY SPIKE and SMART MONEY PRICE CHURN signify?
(i tried to search for the usage notes online, particularly on the thinkscripter site but it is no longer in operation)

also, correct me if I'm wrong but the red, white, magenta, yellow and gray bars are all computed exactly the same as in the original BETTER_VOLUME indicator yes?

@netarchitech
thanks so much!
 
Last edited by a moderator:
I was able to find this my studies collection
Better Momentum


Code:
#
#Better Volume for Thinkorswim
#
#
#hint: Verbatim translation of the TradeStation code from http://emini-watch.com/free-stuff/volume-indicator/
#==========================================================================

#DECLARATIONS
#==========================================================================
declare on_volume;
declare real_size;

#INPUTS
#==========================================================================
input iShowLowVol      = YES;
input iShowClimaxUp    = YES;
input iShowClimaxDown  = YES;
input iShowChurn       = YES;
input iShowClimaxChurn = YES;

input iUseTwoBars = {default "YES", "NO"};
input iLookback   = 20;

#VARS
#==========================================================================
def vValue1;
def vValue2;
def vValue3;
def vValue4;
def vValue5;
def vValue6;
def vValue7;
def vValue8;
def vValue9;
def vValue10;
def vValue11;
def vValue12;
def vValue13;
def vValue14;
def vValue15;
def vValue16;
def vValue17;
def vValue18;
def vValue19;
def vValue20;
def vValue21;
def vValue22;

def vCondition1;
def vCondition2;
def vCondition3;
def vCondition4;
def vCondition5;
def vCondition6;
def vCondition7;
def vCondition8;
def vCondition9;
def vCondition10;
def vCondition11;
def vCondition12;
def vCondition13;
def vCondition14;
def vCondition15;
def vCondition16;
def vCondition17;
def vCondition18;
def vCondition19;
def vCondition20;

def vRange;

#LOGIC
#==========================================================================
vRange = high - low;

if close > open and vRange <> 0
    then {vValue1 = (vRange/(2*vRange + open - close))*volume;
          vValue2 = volume - vValue1;}
else if close < open and vRange <> 0
    then {vValue1 = ((vRange + close - open)/(2*vRange + close - open))*volume;
          vValue2 = volume - vValue1;}
else if close == open
    then {vValue1 = 0.5*volume;
          vValue2 = volume - vValue1;}
    else {vValue1 = 0;
          vValue2 = 0;}

vValue3 = AbsValue(vValue1 + vValue2);
vValue4 = vValue1*vRange;
vValue5 = (vValue1 - vValue2)*vRange;
vValue6 = vValue2*vRange;
vValue7 = (vValue2 - vValue1)*vRange;

if vRange <> 0
    then {vValue8  = vValue1/vRange;
          vValue9  = (vValue1 - vValue2)/vRange;
          vValue10 = vValue2/vRange;
          vValue11 = (vValue2 - vValue1)/vRange;
          vValue12 = vValue3/vRange;}
    else {vValue8  = 0;
          vValue9  = 0;
          vValue10 = 0;
          vValue11 = 0;
          vValue12 = 0;}

switch(iUseTwoBars)
{
    case "YES":
        vValue13 = vValue3 + vValue3[1];
        vValue14 = (vValue1 + vValue1[1])*(Highest(high,2) - Lowest(low,2));
        vValue15 = (vValue1 + vValue1[1] - vValue2 - vValue2[1])*(Highest(high,2) - Lowest(low,2));
        vValue16 = (vValue2 + vValue2[1])*(Highest(high,2) - Lowest(low,2));
        vValue17 = (vValue2 + vValue2[1] - vValue1 - vValue1[1])*(Highest(high,2) - Lowest(low,2));
 
        if Highest(high,2) <> Lowest(low,2)
            then {vValue18 = (vValue1 + vValue1[1])/(Highest(high,2) - Lowest(low,2));
                  vValue19 = (vValue1 + vValue1[1] - vValue2 - vValue2[1])/(Highest(high,2) - Lowest(low,2));
                  vValue20 = (vValue2 + vValue2[1])/(Highest(high,2) - Lowest(low,2));
                  vValue21 = (vValue2 + vValue2[1] - vValue1 - vValue1[1])/(Highest(high,2) - Lowest(low,2));
                  vValue22 = vValue13/(Highest(high,2) - Lowest(low,2));}
            else {vValue18 = 0;
                  vValue19 = 0;
                  vValue20 = 0;
                  vValue21 = 0;
                  vValue22 = 0;}
 
        vCondition1  = 0;
        vCondition2  = 0;
        vCondition3  = 0;
        vCondition4  = 0;
        vCondition5  = 0;
        vCondition6  = 0;
        vCondition7  = 0;
        vCondition8  = 0;
        vCondition9  = 0;
        vCondition10 = 0;
        vCondition11 = vValue13 == Lowest(vValue13, iLookback);
        vCondition12 = vValue14 == Highest(vValue14, iLookback) and close > open and close[1] > open[1];
        vCondition13 = vValue15 == Highest(vValue15, iLookback) and close > open and close[1] > open[1];
        vCondition14 = vValue16 == Highest(vValue16, iLookback) and close < open and close[1] < open[1];
        vCondition15 = vValue17 == Highest(vValue17, iLookback) and close < open and close[1] < open[1];
        vCondition16 = vValue18 == Lowest(vValue18, iLookback)  and close < open and close[1] < open[1];
        vCondition17 = vValue19 == Lowest(vValue19, iLookback)  and close < open and close[1] < open[1];
        vCondition18 = vValue20 == Lowest(vValue20, iLookback)  and close > open and close[1] > open[1];
        vCondition19 = vValue21 == Lowest(vValue21, iLookback)  and close > open and close[1] > open[1];
        vCondition20 = vValue22 == Highest(vValue22, iLookback);
 
    case "NO":
        vValue13 = 0;
        vValue14 = 0;
        vValue15 = 0;
        vValue16 = 0;
        vValue17 = 0;
        vValue18 = 0;
        vValue19 = 0;
        vValue20 = 0;
        vValue21 = 0;
        vValue22 = 0;
 
        vCondition1  = vValue3  == Lowest(vValue3, iLookback);
        vCondition2  = vValue4  == Highest(vValue4, iLookback) and close > open;
        vCondition3  = vValue5  == Highest(vValue5, iLookback) and close > open;
        vCondition4  = vValue6  == Highest(vValue6, iLookback) and close < open;
        vCondition5  = vValue7  == Highest(vValue7, iLookback) and close < open;
        vCondition6  = vValue8  == Lowest(vValue8, iLookback)  and close < open;
        vCondition7  = vValue9  == Lowest(vValue9, iLookback)  and close < open;
        vCondition8  = vValue10 == Lowest(vValue10, iLookback) and close > open;
        vCondition9  = vValue11 == Lowest(vValue11, iLookback) and close > open;
        vCondition10 = vValue12 == Highest(vValue12, iLookback);
        vCondition11 = 0;
        vCondition12 = 0;
        vCondition13 = 0;
        vCondition14 = 0;
        vCondition15 = 0;
        vCondition16 = 0;
        vCondition17 = 0;
        vCondition18 = 0;
        vCondition19 = 0;
        vCondition20 = 0;
}

#PLOTS
#==========================================================================
plot pBetterVolume = volume;

#PLOT STYLES & SETTINGS
#==========================================================================
pBetterVolume.DefineColor("LowVol",      Color.YELLOW);
pBetterVolume.DefineColor("ClimaxUp",    Color.RED);
pBetterVolume.DefineColor("ClimaxDown",  Color.WHITE);
pBetterVolume.DefineColor("Churn",       Color.BLUE);
pBetterVolume.DefineColor("ClimaxChurn", Color.MAGENTA);
pBetterVolume.DefineColor("Default",     Color.BLACK);

pBetterVolume.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

pBetterVolume.AssignValueColor
(
         if iShowLowVol      and (vCondition1 or vCondition11)  then pBetterVolume.Color("LowVol")
    else if iShowClimaxUp    and (vCondition2 or vCondition3 or vCondition8 or vCondition9 or vCondition12
                                  or vCondition13 or vCondition18 or vCondition19)
                                                                  then pBetterVolume.Color("ClimaxUp")
    else if iShowClimaxDown  and (vCondition4 or vCondition5 or vCondition6 or vCondition7 or vCondition14
                                  or vCondition15 or vCondition16 or vCondition17)
                                                                  then pBetterVolume.Color("ClimaxDown")
    else if iShowChurn       and (vCondition10 or vCondition20) then pBetterVolume.Color("Churn")
    else if iShowClimaxChurn and (vCondition10 or vCondition20)
                             and (vCondition2 or vCondition3 or vCondition4 or vCondition5 or vCondition6
                                  or vCondition7 or vCondition8 or vCondition9 or vCondition12
                                  or vCondition13 or vCondition14 or vCondition15 or vCondition16
                                  or vCondition17 or vCondition18 or vCondition19)
                                                                  then pBetterVolume.Color("ClimaxChurn")
    else pBetterVolume.Color("Default")
);

AssignPriceColor
(
         if iShowLowVol      and (vCondition1 or vCondition11)  then pBetterVolume.Color("LowVol")
    else if iShowClimaxUp    and (vCondition2 or vCondition3 or vCondition8 or vCondition9 or vCondition12
                                  or vCondition13 or vCondition18 or vCondition19)
                                                                  then pBetterVolume.Color("ClimaxUp")
    else if iShowClimaxDown  and (vCondition4 or vCondition5 or vCondition6 or vCondition7 or vCondition14
                                  or vCondition15 or vCondition16 or vCondition17)
                                                                  then pBetterVolume.Color("ClimaxDown")
    else if iShowChurn       and (vCondition10 or vCondition20) then pBetterVolume.Color("Churn")
    else if iShowClimaxChurn and (vCondition10 or vCondition20)
                             and (vCondition2 or vCondition3 or vCondition4 or vCondition5 or vCondition6
                                  or vCondition7 or vCondition8 or vCondition9 or vCondition12
                                  or vCondition13 or vCondition14 or vCondition15 or vCondition16
                                  or vCondition17 or vCondition18 or vCondition19)
                                                                  then pBetterVolume.Color("ClimaxChurn")
    else pBetterVolume.Color("Default")
);
Anyone ever add plots to scan for the bars, climaxup, climaxdown, churn, climaxchurn ?
 
my trading method has changed and I do not want to steer anybody wrong or making continuous annoying posts.
https://usethinkscript.com/threads/...n-and-average-for-thinkorswim.853/#post-93963


Here is the code. Remember the "smart money" control the markets.
declare lower;

# BetterVolume
# Adapted from the BetterVolume Indicator:
# http://emini-watch.com/free-stuff/volume-indicator/
# By
# http://thinkscripter.wordpress.com
# thinkscripter@...
# Last Update 19 APR 2009


# 7/25/2010 Re-written to include:
# - user selectable volume color bars
# - the option to turn price color bars off
# - there is no min v/r function in this study (formerly painted as a Climax Down bar)
# See forum thread discussion for important information about the study

# 8/2/2010 'Magenta toxicity' is now absent.
# 8/3/2010:
# The previous versions had the possibility of painting HighVolumeChurn bars when the
# condition was also a low volume condition. In this study low volume takes precedence.
# 8/4/2010: rev 3: Well the above didn't fix the low volume/high volume churn as I had expected.
# This fix should.
# 8/4/2010 Replaced Simple MA on Volume with Wilders Average (2 period)
# 8/5/2010 Added Price Volatility Spike Color Bar

#declare on_volume;
declare real_size;


input MA_Period = 10;
input LookBack = 10;
input ShowColorOnPrice = Yes;
def closeLog = Log(close[1] / close[2]);
def SDeva = StDev(closeLog, LookBack) * Sqrt(LookBack / (LookBack - 1));
def m = SDeva * close[1];
def spike = (close[0] - close[1]) / m;


def PriceColor = ShowColorOnPrice && volume;
def Range = high - low;
def VxR = volume * Range;
def VperR = if Range <> 0 then volume / Range else 0;
def LowVolume = volume == Lowest(volume, LookBack);
def ClimaxUp = VxR == Highest(VxR, LookBack) && close > open && !LowVolume;
def ClimaxDn = VxR == Highest(VxR, LookBack) && close < open && !LowVolume;
def HighVolumeChurn = VperR == Highest(VperR, LookBack) && !LowVolume;
def ClimaxChurn = (ClimaxUp or ClimaxDn) && HighVolumeChurn;

plot BetterVolume = volume;
BetterVolume.DefineColor("ClimaxUpColor", Color.RED);
BetterVolume.DefineColor("ClimaxDnColor", Color.WHITE);
BetterVolume.DefineColor("HighVolumeChurnColor", CreateColor(51, 102, 255));
BetterVolume.DefineColor("LowVolumeColor", Color.YELLOW);
BetterVolume.DefineColor("ClimaxChurnColor", Color.MAGENTA);
BetterVolume.DefineColor("DefaultColor", CreateColor(51, 51, 51));
BetterVolume.DefineColor("PriceChurnColor", Color.LIGHT_GREEN);
BetterVolume.DefineColor("SpikeColor", Color.CYAN);

#plot AverageVolume = Average(volume, MA_Period);
#AverageVolume.SetDefaultColor(color.red);
plot WilderAveVol = WildersAverage(volume, 2);
WilderAveVol.SetDefaultColor(CreateColor(128, 128, 128));

BetterVolume.AssignValueColor ( if ClimaxChurn then BetterVolume.Color("ClimaxChurnColor") else
if ClimaxUp then BetterVolume.Color("ClimaxUpColor") else
if ClimaxDn then BetterVolume.Color("ClimaxDnColor") else
if HighVolumeChurn then BetterVolume.Color("HighVolumeChurnColor") else
if LowVolume then BetterVolume.Color("LowVolumeColor")
else BetterVolume.Color("DefaultColor"));

BetterVolume.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
BetterVolume.SetLineWeight(5);

AssignPriceColor( if spike > 3.0 or spike < -3.0 then BetterVolume.Color("SpikeColor") else if ClimaxChurn && PriceColor then BetterVolume.Color("ClimaxChurnColor") else
if ClimaxUp && PriceColor then BetterVolume.Color("ClimaxUpColor") else
if ClimaxDn && PriceColor then BetterVolume.Color("ClimaxDnColor") else
if HighVolumeChurn && PriceColor then BetterVolume.Color("PriceChurnColor") else
if LowVolume && PriceColor then BetterVolume.Color("LowVolumeColor") else
if PriceColor then BetterVolume.Color("DefaultColor") else
Color.CURRENT);

#
# *************************************************************
# INDICATOR'S COLOR LEGEND
# *************************************************************
AddLabel(yes, "Amateur Trading", BetterVolume.Color("LowVolumeColor"));
AddLabel(yes, "Smart Money Volume Churn", BetterVolume.Color("HighVolumeChurnColor"));
AddLabel(yes, "Smart Money Price Churn", BetterVolume.Color("PriceChurnColor"));
AddLabel(yes, "Climax Down", BetterVolume.Color("ClimaxDnColor"));
AddLabel(yes, "Climax Up", BetterVolume.Color("ClimaxUpColor"));
AddLabel(yes, "Climax Churn", BetterVolume.Color("ClimaxChurnColor"));
AddLabel(yes, "Smart Money Spike", BetterVolume.Color("SpikeColor"));
AddLabel(yes, "Normal", BetterVolume.Color("DefaultColor"));


Hope you understand everything and good luck trading. Feel free to ask any questions you like!
Thanks for your time. --Keith
Added Plots for scans:
Plot LowVol = LowVolume;
Plot Clmxup = ClimaxUp;
Plot ClmaxDn = ClimaxDn;
Plot HiVolChurn = HighVolumeChurn;
Plot ClmChurn = ClimaxChurn;

Your Code with the added plots below:

# BetterVolume
# Adapted from the BetterVolume Indicator:
# http://emini-watch.com/free-stuff/volume-indicator/
# By
# http://thinkscripter.wordpress.com
# thinkscripter@...
# Last Update 19 APR 2009


# 7/25/2010 Re-written to include:
# - user selectable volume color bars
# - the option to turn price color bars off
# - there is no min v/r function in this study (formerly painted as a Climax Down bar)
# See forum thread discussion for important information about the study

# 8/2/2010 'Magenta toxicity' is now absent.
# 8/3/2010:
# The previous versions had the possibility of painting HighVolumeChurn bars when the
# condition was also a low volume condition. In this study low volume takes precedence.
# 8/4/2010: rev 3: Well the above didn't fix the low volume/high volume churn as I had expected.
# This fix should.
# 8/4/2010 Replaced Simple MA on Volume with Wilders Average (2 period)
# 8/5/2010 Added Price Volatility Spike Color Bar

#declare on_volume;
declare real_size;


input MA_Period = 10;
input LookBack = 10;
input ShowColorOnPrice = Yes;
def closeLog = Log(close[1] / close[2]);
def SDeva = StDev(closeLog, LookBack) * Sqrt(LookBack / (LookBack - 1));
def m = SDeva * close[1];
def spike = (close[0] - close[1]) / m;


def PriceColor = ShowColorOnPrice && volume;
def Range = high - low;
def VxR = volume * Range;
def VperR = if Range <> 0 then volume / Range else 0;
def LowVolume = volume == Lowest(volume, LookBack);
def ClimaxUp = VxR == Highest(VxR, LookBack) && close > open && !LowVolume;
def ClimaxDn = VxR == Highest(VxR, LookBack) && close < open && !LowVolume;
def HighVolumeChurn = VperR == Highest(VperR, LookBack) && !LowVolume;
def ClimaxChurn = (ClimaxUp or ClimaxDn) && HighVolumeChurn;

plot BetterVolume = volume;
BetterVolume.DefineColor("ClimaxUpColor", Color.RED);
BetterVolume.DefineColor("ClimaxDnColor", Color.WHITE);
BetterVolume.DefineColor("HighVolumeChurnColor", CreateColor(51, 102, 255));
BetterVolume.DefineColor("LowVolumeColor", Color.YELLOW);
BetterVolume.DefineColor("ClimaxChurnColor", Color.MAGENTA);
BetterVolume.DefineColor("DefaultColor", CreateColor(51, 51, 51));
BetterVolume.DefineColor("PriceChurnColor", Color.LIGHT_GREEN);
BetterVolume.DefineColor("SpikeColor", Color.CYAN);

Plot LowVol = LowVolume;
Plot Clmxup = ClimaxUp;
Plot ClmaxDn = ClimaxDn;
Plot HiVolChurn = HighVolumeChurn;
Plot ClmChurn = ClimaxChurn;

#plot AverageVolume = Average(volume, MA_Period);
#AverageVolume.SetDefaultColor(color.red);
plot WilderAveVol = WildersAverage(volume, 2);
WilderAveVol.SetDefaultColor(CreateColor(128, 128, 128));

BetterVolume.AssignValueColor ( if ClimaxChurn then BetterVolume.Color("ClimaxChurnColor") else
if ClimaxUp then BetterVolume.Color("ClimaxUpColor") else
if ClimaxDn then BetterVolume.Color("ClimaxDnColor") else
if HighVolumeChurn then BetterVolume.Color("HighVolumeChurnColor") else
if LowVolume then BetterVolume.Color("LowVolumeColor")
else BetterVolume.Color("DefaultColor"));

BetterVolume.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
BetterVolume.SetLineWeight(5);

AssignPriceColor( if spike > 3.0 or spike < -3.0 then BetterVolume.Color("SpikeColor") else if ClimaxChurn && PriceColor then BetterVolume.Color("ClimaxChurnColor") else
if ClimaxUp && PriceColor then BetterVolume.Color("ClimaxUpColor") else
if ClimaxDn && PriceColor then BetterVolume.Color("ClimaxDnColor") else
if HighVolumeChurn && PriceColor then BetterVolume.Color("PriceChurnColor") else
if LowVolume && PriceColor then BetterVolume.Color("LowVolumeColor") else
if PriceColor then BetterVolume.Color("DefaultColor") else
Color.CURRENT);

#
# *************************************************************
# INDICATOR'S COLOR LEGEND
# *************************************************************
AddLabel(yes, "Amateur Trading", BetterVolume.Color("LowVolumeColor"));
AddLabel(yes, "Smart Money Volume Churn", BetterVolume.Color("HighVolumeChurnColor"));
AddLabel(yes, "Smart Money Price Churn", BetterVolume.Color("PriceChurnColor"));
AddLabel(yes, "Climax Down", BetterVolume.Color("ClimaxDnColor"));
AddLabel(yes, "Climax Up", BetterVolume.Color("ClimaxUpColor"));
AddLabel(yes, "Climax Churn", BetterVolume.Color("ClimaxChurnColor"));
AddLabel(yes, "Smart Money Spike", BetterVolume.Color("SpikeColor"));
AddLabel(yes, "Normal", BetterVolume.Color("DefaultColor"));
 
Greetings All, When using the Better Volume Indicator on a tick chart how do you get the histogram to not be the same height? How do you "change the histogram setting from Tick Count to Trade Vol"? Thank you!
 
Greetings All, When using the Better Volume Indicator on a tick chart how do you get the histogram to not be the same height? How do you "change the histogram setting from Tick Count to Trade Vol"? Thank you!
I believe a tick chart displays the same amount of volume per bar printed so each bar will be the same height.
 
Volume drives price.
The thinking is to filter your corral of eligible stocks by the standard of Average(volume,50) > 1000000. Thus making sure you are picking the stocks being traded by the Industrial Traders and Algos as they are who move markets. AND THEN look at the buying /selling percentages to see who is in charge.
Read more about Better Volume: https://usethinkscript.com/threads/better-volume-indicator-for-thinkorswim.108/
Possible to share you code with these labels about Amateur etc?

Thanks. Did you mean - https://usethinkscript.com/threads/better-volume-indicator-for-thinkorswim.108/post-45573

It is not written in ToS language and it does not take the code script. I saw you having those labels and asked. and "climax" would mean confirmation on that side, right?

I just want to make sure i can interpret the colors appropriately.

Better Volume PaintBar - EasyLanguage - Version 19 August 2012

Code:
Inputs:  LowVol(True), ClimaxUp(True), ClimaxDown(True), Churn(True), ClimaxChurn(False), LowVolColor(Yellow), ClimaxUpColor(Red), ClimaxDownColor(White), ChurnColor(Blue), ClimaxChurnColor(Magenta), Color(Green), UseUpTicks(True), Use2Bars(True);
Variables:  BarColor(Green), Lookback(20);

BarColor = Color;

If BarType > 1 then begin
    If C > O and Range <> 0 then Value1 = (Range/(2*Range+O-C))*V;
    If C < O and Range <> 0 then Value1 = ((Range+C-O)/(2*Range+C-O))*V;
    If C = O then Value1 = 0.5*V;
    Value2 = V-Value1;
End;
If BarType <= 1 and UseUpTicks = False then begin
    If C > O and Range <> 0 then Value1 = (Range/(2*Range+O-C))*Ticks;
    If C < O and Range <> 0 then Value1 = ((Range+C-O)/(2*Range+C-O))*Ticks;
    If C = O then Value1 = 0.5*Ticks;
    Value2 = Ticks-Value1;
End;
If BarType <= 1 and UseUpTicks then begin
    Value1 = UpTicks;
    Value2 = DownTicks;
End;

Value3 = AbsValue(Value1+Value2);
Value4 = Value1*Range;
Value5 = (Value1-Value2)*Range;
Value6 = Value2*Range;
Value7 = (Value2-Value1)*Range;
If Range <> 0 then begin
    Value8 = Value1/Range;
    Value9 = (Value1-Value2)/Range;
    Value10 = Value2/Range;
    Value11 = (Value2-Value1)/Range;
    Value12 = Value3/Range;
End;
If Use2Bars then begin
    Value13 = Value3+Value3[1];
    Value14 = (Value1+Value1[1])*(Highest(H,2)-Lowest(L,2));
    Value15 = (Value1+Value1[1]-Value2-Value2[1])*(Highest(H,2)-Lowest(L,2));
    Value16 = (Value2+Value2[1])*(Highest(H,2)-Lowest(L,2));
    Value17 = (Value2+Value2[1]-Value1-Value1[1])*(Highest(H,2)-Lowest(L,2));
    If Highest(H,2) <> Lowest(L,2) then begin
        Value18 = (Value1+Value1[1])/(Highest(H,2)-Lowest(L,2));
        Value19 = (Value1+Value1[1]-Value2-Value2[1])/(Highest(H,2)-Lowest(L,2));
        Value20 = (Value2+Value2[1])/(Highest(H,2)-Lowest(L,2));
        Value21 = (Value2+Value2[1]-Value1-Value1[1])/(Highest(H,2)-Lowest(L,2));
        Value22 = Value13/(Highest(H,2)-Lowest(L,2));
    End;
End;

Condition1 = Value3 = Lowest(Value3,Lookback);
Condition2 = Value4 = Highest(Value4,Lookback) and C > O;
Condition3 = Value5 = Highest(Value5,Lookback) and C > O;
Condition4 = Value6 = Highest(Value6,Lookback) and C < O;
Condition5 = Value7 = Highest(Value7,Lookback) and C < O;
Condition6 = Value8 = Lowest(Value8,Lookback) and C < O;
Condition7 = Value9 = Lowest(Value9,Lookback) and C < O;
Condition8 = Value10 = Lowest(Value10,Lookback) and C > O;
Condition9 = Value11 = Lowest(Value11,Lookback) and C > O;
Condition10 = Value12 = Highest(Value12,Lookback);
If Use2Bars then begin
    Condition11 = Value13 = Lowest(Value13,Lookback);
    Condition12 = Value14 = Highest(Value14,Lookback) and C > O and C[1] > O[1];
    Condition13 = Value15 = Highest(Value15,Lookback) and C > O and C[1] > O[1];
    Condition14 = Value16 = Highest(Value16,Lookback) and C < O and C[1] < O[1];
    Condition15 = Value17 = Highest(Value17,Lookback) and C < O and C[1] < O[1];
    Condition16 = Value18 = Lowest(Value18,Lookback) and C < O and C[1] < O[1];
    Condition17 = Value19 = Lowest(Value19,Lookback) and C < O and C[1] < O[1];
    Condition18 = Value20 = Lowest(Value20,Lookback) and C > O and C[1] > O[1];
    Condition19 = Value21 = Lowest(Value21,Lookback) and C > O and C[1] > O[1];
    Condition20 = Value22 = Highest(Value22,Lookback);
End;

If BarType > 1 then begin
    If LowVol and (Condition1 or Condition11) then BarColor = LowVolColor;
    If ClimaxUp and (Condition2 or Condition3 or Condition8 or Condition9 or Condition12 or Condition13 or Condition18 or Condition19) then BarColor = ClimaxUpColor;
    If ClimaxDown and (Condition4 or Condition5 or Condition6 or Condition7 or Condition14 or Condition15 or Condition16 or Condition17) then BarColor = ClimaxDownColor;
    If Churn and (Condition10 or Condition20) then BarColor = ChurnColor;
    If ClimaxChurn and (Condition10 or Condition20) and (Condition2 or Condition3 or Condition4 or Condition5 or Condition6 or Condition7 or Condition8 or Condition9 or
        Condition12 or Condition13 or Condition14 or Condition15 or Condition16 or Condition17 or Condition18 or Condition19) then BarColor = ClimaxChurnColor;
End;

If BarType <= 1 then begin
    If LowVol and (Condition1 or (Condition11 and D=D[1])) then BarColor = LowVolColor;
    If ClimaxUp and (Condition2 or Condition3 or Condition8 or Condition9 or ((Condition12 or Condition13 or Condition18 or Condition19) and D=D[1])) then BarColor = ClimaxUpColor;
    If ClimaxDown and (Condition4 or Condition5 or Condition6 or Condition7 or ((Condition14 or Condition15 or Condition16 or Condition17) and D=D[1])) then BarColor = ClimaxDownColor;
    If Churn and (Condition10 or (Condition20 and D=D[1])) then BarColor = ChurnColor;
    If ClimaxChurn and (Condition10 or (Condition20 and D=D[1])) and (Condition2 or Condition3 or Condition4 or Condition5 or Condition6 or Condition7 or Condition8 or Condition9 or
        ((Condition12 or Condition13 or Condition14 or Condition15 or Condition16 or Condition17 or Condition18 or Condition19) and D=D[1])) then BarColor = ClimaxChurnColor;
End;

If BarColor <> Color then PlotPaintBar(H,L,O,C,"BetterVol",BarColor);

{ Change Log: }
{23 November 2007 - Added LowChurn colored volume bars                      }
{28 March 2008 - Added ability to turn on and off different colored bars    }
{28 March 2008 - Got rid of redundant code calculations                     }
{19 April 2008 - Got rid of LowChurn and replaced with ClimaxDown           }
{19 April 2008 - Added open & close conditions with ClimaxUp and ClimaxDown }
{19 April 2008 - Added different calculations for tick/intra-day charts     }
{13 July 2008 - Added 2 bar climax, churn and low volume conditions         }
{4 September 2008 - Changed daily bars calculation to match tick/intra-day  }
{25 January 2009 - Added condition total volume (Value3) could not be -ve   }
{3 July 2009 - Allowed the default bar coloring to be changed               }
{19 August 2012 - Changed calculation for Intra-day + UseUpTicks = False    }

Is there a share-able link to this? This is not in ToS script. Also -- can you someone help explain the churn and climax? Thanks, What do these terms mean with those colors in options.
 
Last edited by a moderator:
Possible to share you code with these labels about Amateur etc?

I noticed you chose a script variation of the Better Volume Indicator that wasn't written in ThinkOrSwim (ToS) language.

To avoid any confusion, that EasyStation code has been removed.
All the other scripts in this thread are written in ToS.
It might be best to start with the first one:
https://usethinkscript.com/threads/better-volume-indicator-for-thinkorswim.108/#post-548

For directions on how to cut & paste a script into ToS:
https://usethinkscript.com/threads/how-to-import-existing-thinkscript-code-on-thinkorswim.10/

For a write up about this indicator:

#hint: Verbatim translation of the TradeStation code from http://emini-watch.com/free-stuff/volume-indicator/

# TS_BetterVolume_Indicator
# A better volume indicator with color coded histogram plot that shows 4 different colors depending on price action and volume.
# Yellow - Low volume for the size of the bar - Amateurs at work
# White - Climax down
# Blue -Climax up
# Red - Churn - Pros buying at lows or unloading at highs
# Magenta - Climax Churn - Pros taking profits at highs or lows
# Gray - Normal (default) Bar
 
Last edited:
# TS_BetterVolume_Indicator
# A better volume indicator with color coded histogram plot that shows 4 different colors depending on price action and volume.
# Yellow - Low volume for the size of the bar - Amateurs at work
# White - Climax down
# Blue -Climax up
# Red - Churn - Pros buying at lows or unloading at highs
# Magenta - Climax Churn - Pros taking profits at highs or lows
# Gray - Normal (default) Bar

View attachment 4383

thinkScript Code

Rich (BB code):
#
#Better Volume for Thinkorswim
#
#
#hint: Verbatim translation of the TradeStation code from http://emini-watch.com/free-stuff/volume-indicator/
#==========================================================================

#DECLARATIONS
#==========================================================================
declare on_volume;
declare real_size;

#INPUTS
#==========================================================================
input iShowLowVol      = YES;
input iShowClimaxUp    = YES;
input iShowClimaxDown  = YES;
input iShowChurn       = YES;
input iShowClimaxChurn = YES;

input iUseTwoBars = {default "YES", "NO"};
input iLookback   = 20;

#VARS
#==========================================================================
def vValue1;
def vValue2;
def vValue3;
def vValue4;
def vValue5;
def vValue6;
def vValue7;
def vValue8;
def vValue9;
def vValue10;
def vValue11;
def vValue12;
def vValue13;
def vValue14;
def vValue15;
def vValue16;
def vValue17;
def vValue18;
def vValue19;
def vValue20;
def vValue21;
def vValue22;

def vCondition1;
def vCondition2;
def vCondition3;
def vCondition4;
def vCondition5;
def vCondition6;
def vCondition7;
def vCondition8;
def vCondition9;
def vCondition10;
def vCondition11;
def vCondition12;
def vCondition13;
def vCondition14;
def vCondition15;
def vCondition16;
def vCondition17;
def vCondition18;
def vCondition19;
def vCondition20;

def vRange;

#LOGIC
#==========================================================================
vRange = high - low;

if close > open and vRange <> 0
    then {vValue1 = (vRange/(2*vRange + open - close))*volume;
          vValue2 = volume - vValue1;}
else if close < open and vRange <> 0
    then {vValue1 = ((vRange + close - open)/(2*vRange + close - open))*volume;
          vValue2 = volume - vValue1;}
else if close == open
    then {vValue1 = 0.5*volume;
          vValue2 = volume - vValue1;}
    else {vValue1 = 0;
          vValue2 = 0;}

vValue3 = AbsValue(vValue1 + vValue2);
vValue4 = vValue1*vRange;
vValue5 = (vValue1 - vValue2)*vRange;
vValue6 = vValue2*vRange;
vValue7 = (vValue2 - vValue1)*vRange;

if vRange <> 0
    then {vValue8  = vValue1/vRange;
          vValue9  = (vValue1 - vValue2)/vRange;
          vValue10 = vValue2/vRange;
          vValue11 = (vValue2 - vValue1)/vRange;
          vValue12 = vValue3/vRange;}
    else {vValue8  = 0;
          vValue9  = 0;
          vValue10 = 0;
          vValue11 = 0;
          vValue12 = 0;}

switch(iUseTwoBars)
{
    case "YES":
        vValue13 = vValue3 + vValue3[1];
        vValue14 = (vValue1 + vValue1[1])*(Highest(high,2) - Lowest(low,2));
        vValue15 = (vValue1 + vValue1[1] - vValue2 - vValue2[1])*(Highest(high,2) - Lowest(low,2));
        vValue16 = (vValue2 + vValue2[1])*(Highest(high,2) - Lowest(low,2));
        vValue17 = (vValue2 + vValue2[1] - vValue1 - vValue1[1])*(Highest(high,2) - Lowest(low,2));
 
        if Highest(high,2) <> Lowest(low,2)
            then {vValue18 = (vValue1 + vValue1[1])/(Highest(high,2) - Lowest(low,2));
                  vValue19 = (vValue1 + vValue1[1] - vValue2 - vValue2[1])/(Highest(high,2) - Lowest(low,2));
                  vValue20 = (vValue2 + vValue2[1])/(Highest(high,2) - Lowest(low,2));
                  vValue21 = (vValue2 + vValue2[1] - vValue1 - vValue1[1])/(Highest(high,2) - Lowest(low,2));
                  vValue22 = vValue13/(Highest(high,2) - Lowest(low,2));}
            else {vValue18 = 0;
                  vValue19 = 0;
                  vValue20 = 0;
                  vValue21 = 0;
                  vValue22 = 0;}
 
        vCondition1  = 0;
        vCondition2  = 0;
        vCondition3  = 0;
        vCondition4  = 0;
        vCondition5  = 0;
        vCondition6  = 0;
        vCondition7  = 0;
        vCondition8  = 0;
        vCondition9  = 0;
        vCondition10 = 0;
        vCondition11 = vValue13 == Lowest(vValue13, iLookback);
        vCondition12 = vValue14 == Highest(vValue14, iLookback) and close > open and close[1] > open[1];
        vCondition13 = vValue15 == Highest(vValue15, iLookback) and close > open and close[1] > open[1];
        vCondition14 = vValue16 == Highest(vValue16, iLookback) and close < open and close[1] < open[1];
        vCondition15 = vValue17 == Highest(vValue17, iLookback) and close < open and close[1] < open[1];
        vCondition16 = vValue18 == Lowest(vValue18, iLookback)  and close < open and close[1] < open[1];
        vCondition17 = vValue19 == Lowest(vValue19, iLookback)  and close < open and close[1] < open[1];
        vCondition18 = vValue20 == Lowest(vValue20, iLookback)  and close > open and close[1] > open[1];
        vCondition19 = vValue21 == Lowest(vValue21, iLookback)  and close > open and close[1] > open[1];
        vCondition20 = vValue22 == Highest(vValue22, iLookback);
 
    case "NO":
        vValue13 = 0;
        vValue14 = 0;
        vValue15 = 0;
        vValue16 = 0;
        vValue17 = 0;
        vValue18 = 0;
        vValue19 = 0;
        vValue20 = 0;
        vValue21 = 0;
        vValue22 = 0;
 
        vCondition1  = vValue3  == Lowest(vValue3, iLookback);
        vCondition2  = vValue4  == Highest(vValue4, iLookback) and close > open;
        vCondition3  = vValue5  == Highest(vValue5, iLookback) and close > open;
        vCondition4  = vValue6  == Highest(vValue6, iLookback) and close < open;
        vCondition5  = vValue7  == Highest(vValue7, iLookback) and close < open;
        vCondition6  = vValue8  == Lowest(vValue8, iLookback)  and close < open;
        vCondition7  = vValue9  == Lowest(vValue9, iLookback)  and close < open;
        vCondition8  = vValue10 == Lowest(vValue10, iLookback) and close > open;
        vCondition9  = vValue11 == Lowest(vValue11, iLookback) and close > open;
        vCondition10 = vValue12 == Highest(vValue12, iLookback);
        vCondition11 = 0;
        vCondition12 = 0;
        vCondition13 = 0;
        vCondition14 = 0;
        vCondition15 = 0;
        vCondition16 = 0;
        vCondition17 = 0;
        vCondition18 = 0;
        vCondition19 = 0;
        vCondition20 = 0;
}

#PLOTS
#==========================================================================
plot pBetterVolume = volume;

#PLOT STYLES & SETTINGS
#==========================================================================
pBetterVolume.DefineColor("LowVol",      Color.YELLOW);
pBetterVolume.DefineColor("ClimaxUp",    Color.RED);
pBetterVolume.DefineColor("ClimaxDown",  Color.WHITE);
pBetterVolume.DefineColor("Churn",       Color.BLUE);
pBetterVolume.DefineColor("ClimaxChurn", Color.MAGENTA);
pBetterVolume.DefineColor("Default",     Color.CYAN);

pBetterVolume.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

pBetterVolume.AssignValueColor
(
         if iShowLowVol      and (vCondition1 or vCondition11)  then pBetterVolume.Color("LowVol")
    else if iShowClimaxUp    and (vCondition2 or vCondition3 or vCondition8 or vCondition9 or vCondition12
                                  or vCondition13 or vCondition18 or vCondition19)
                                                                  then pBetterVolume.Color("ClimaxUp")
    else if iShowClimaxDown  and (vCondition4 or vCondition5 or vCondition6 or vCondition7 or vCondition14
                                  or vCondition15 or vCondition16 or vCondition17)
                                                                  then pBetterVolume.Color("ClimaxDown")
    else if iShowChurn       and (vCondition10 or vCondition20) then pBetterVolume.Color("Churn")
    else if iShowClimaxChurn and (vCondition10 or vCondition20)
                             and (vCondition2 or vCondition3 or vCondition4 or vCondition5 or vCondition6
                                  or vCondition7 or vCondition8 or vCondition9 or vCondition12
                                  or vCondition13 or vCondition14 or vCondition15 or vCondition16
                                  or vCondition17 or vCondition18 or vCondition19)
                                                                  then pBetterVolume.Color("ClimaxChurn")
    else pBetterVolume.Color("Default")
);

AssignPriceColor
(
         if iShowLowVol      and (vCondition1 or vCondition11)  then pBetterVolume.Color("LowVol")
    else if iShowClimaxUp    and (vCondition2 or vCondition3 or vCondition8 or vCondition9 or vCondition12
                                  or vCondition13 or vCondition18 or vCondition19)
                                                                  then pBetterVolume.Color("ClimaxUp")
    else if iShowClimaxDown  and (vCondition4 or vCondition5 or vCondition6 or vCondition7 or vCondition14
                                  or vCondition15 or vCondition16 or vCondition17)
                                                                  then pBetterVolume.Color("ClimaxDown")
    else if iShowChurn       and (vCondition10 or vCondition20) then pBetterVolume.Color("Churn")
    else if iShowClimaxChurn and (vCondition10 or vCondition20)
                             and (vCondition2 or vCondition3 or vCondition4 or vCondition5 or vCondition6
                                  or vCondition7 or vCondition8 or vCondition9 or vCondition12
                                  or vCondition13 or vCondition14 or vCondition15 or vCondition16
                                  or vCondition17 or vCondition18 or vCondition19)
                                                                  then pBetterVolume.Color("ClimaxChurn")
    else pBetterVolume.Color("Default")
);

Colors can be configured in the study customization window:

View attachment 4385

Shareable Link

https://tos.mx/PDkQYF

Code:
Source: https://thinkscripter.com/

Credit: Fil @ analyticsfortraders.com

More Info: https://emini-watch.com/free-stuff/volume-indicator/

Better Volume_v3 by Mobius

Code:
#Hint: BetterVolume_v3 \n Shows volume and dbl average as well as Vol_Buzz \n VolBuzz is current bar volume vs the average volume for a relatively longer period = VolAvgPeriod \n  The directional volume is the Net of Buy vs Sell avg vol for N = Length bars \n v3 adds  informative labels with dynamic coloring & options in visualization - in V3 we switch to Barry Taylor's algo for directional volume calc \n RedK @ Live . com  ---  Mayl 2013

declare lower;
#declare zerobase;

input Length = 7;
input VolAvgPeriod = 50;
input Volume_Bias_Based_on = { default "Close_Price" , "Trend" }; ## this makes a difference only in few bars.. it's not used in any calc
input VolPlotMode= { default "Both", "Classic" , "Pressure" };
input ShowLabels = yes;
Input VxNetSmooth = 3;

def VolState;
switch (Volume_Bias_Based_on) {
case Trend:
    VolState = if close > close[1] then 1 else if close == close [1] then 0 else -1;
default :
    VolState = if close > open then 1 else if close == open then 0 else  -1;
}

plot Vol = volume;
Vol.sethiding( VolPlotMode == VolPlotMode.Pressure);
plot VolSlowAvg = Average(volume, VolAvgPeriod);
plot VolFastAvg = WMA(volume, Length);

Vol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Vol.SetLineWeight(3);
Vol.DefineColor("Up", Color.UPTICK);
Vol.DefineColor("Down", Color.DOWNTICK);
Vol.DefineColor("Doji", GetColor(8));

Vol.AssignValueColor(if VolState == 1 then Vol.Color("Up") else if VolState == -1 then Vol.Color("Down") else Vol.Color("Doji"));
VolSlowAvg.SetDefaultColor(color.blue);
VolFastAvg.SetDefaultColor(Color.orange); VolFastAvg.setStyle (curve.SHORT_DASH);
VolFastAvg.SetLineWeight(1);

def VolBuzz = Round((volume / VolSlowAvg * 100), 1);
def FastVRatio = Round((VolFastAvg / VolSlowAvg * 100), 1);
AddLabel(ShowLabels, "Vol_Buzz: " + VolBuzz + "%", if VolBuzz < 80 then Color.dark_orange else if VolBuzz > 120 then Color.GREEN else Color.Yellow) ;

## adding a volume Dx (Directional Index) calc .. similar to Elder's calc, but uses all volume compared to Avg Volume during Fast Length
# in V3, we change to use the algo in BetterVolume study originally developed by Barry Taylor at EminiWatch for TradeStation
# this algo is OK (though i believe not the best) , and signal is better than using the whole volume bar as up or down.
## v3.a - add a PressureCalc option to see either WMA or SUM of directional volume
input VolPressureCalc= { default "WAverage", "Sum" };

def Vx =  if VolPressureCalc == VolPressureCalc.SUM then sum(volume,Length) else WMA(volume, Length) ;
def C = close; def O = Open; Def Range = High - low;
Def VolUp = If C > O and Range <> 0 then (Range/(2*Range+O-C))*Volume
else If C < O and Range <> 0 then ((Range+C-O)/(2*Range+C-O))*Volume
else 0.5*Volume;

def VolDn = Volume - VolUp;

def VxPlus = if VolPressureCalc == VolPressureCalc.SUM then sum (VolUp, Length) else WMA (VolUp, Length);
def VxMinus = if VolPressureCalc == VolPressureCalc.SUM then sum (VolDn, Length) else WMA (VolDn, Length);

def VxNetRaw = VXPlus-VXMinus ;

## Smooth with a very short zero-lag to eliminate outliers - Color the result
plot VxNet = 2 * WMA(VxNetRaw, VxNetSmooth) - WMA(WMA(VxNetRaw, VxNetSmooth),VxNetSmooth);
VxNet.DefineColor("PosUp", Color.GREEN);
VxNet.DefineColor("PosDn", Color.DARK_GREEN);
VxNet.DefineColor("NegDn", Color.RED);
VxNet.DefineColor("NegUp", Color.DARK_RED);
VxNet.AssignValueColor(if VxNet >= 0 then if VxNet > VxNet[1] then VxNet.color("PosUp") else VxNet.color("PosDn") else if VxNet < VxNet[1] then VxNet.color("NegDn") else VxNet.color("NegUp"));
VXNet.setlineWeight (3);
VxNet.sethiding(VolPlotMode == VolPlotMode.Classic);

## add volume pressure shade and the labels
def VxRatio = round(100 * VxNetRaw/VX,1);
def VxCloud = if VolPlotMode != VolPlotMode.Classic then VxNet else double.NaN ;
addcloud(VXCloud, 0);
AddLabel(ShowLabels, "FastVol: " + FastVRatio + "%", if FastVRatio > 100 then if VxRatio < 0 then Color.light_red else Color.GREEN else Color.orange) ;
AddLabel (ShowLabels ,"VxPlus: "+ round(VxPlus/VX*100,1)+"%", color.light_green);
AddLabel (ShowLabels , "VxMinus: "+ round(VxMinus/VX*100,1)+"%", color.Light_red);
AddLabel (ShowLabels , "VxNet: " + VxRatio + "%", if between(VxRatio, -10, 10) then color.yellow else if VxRatio >= 10 then color.green else color.dark_orange);

Maybe I missed something in the OP but I just wanted to point out that I noticed the default colors of "climax up" and "churn" were opposite of what was described as the default colors at the top of the OP, at least for the code provided at the top of the OP. Just a heads up for anyone plugging it in.
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
399 Online
Create Post

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top