Working Volume Indicator for Range/Renko Bars

Several months ago, while messing around with Horseriders RSI indicator, when I added parts of the previous volume indicator, which I tweaked to my liking, I discovered it would display on Range/Renko Charts

The arrows are suppose to signify when volume is 250/500% greater than the 30 day Avg. and the buy vol is greater than 70% for that bar and vice versa for sell Volume. Whether this is actually working correctly on Range/Renko Bars is frankly, beyond me....Looking thru the charts, if used with price action, it does appear to be useful.

Attached is a 3 day ATR chart and a 3 yr ATR Range chart.

VIkcRqW.png


epAaobg.png


The "Sell" label only indicates that the current bars sell volume is greater than 70% and does not indicate that you should actually go short

Note - removed some labels from original volume indicator as they prevented the indicator from displaying on Range/Renko Charts

Code:
#While working with the indicator "RSI Bands and Double RSI SMA Cross Long Term Trades" and the volume study, I inadertently stumpled upon volume working with Range/Renko Bars - RedtoGreen 12/30/2020
#Created by Horserider 7/20/2019
#*RSI code removed*

#Derived from Volume Buy Sell Indicator with Hot Percent for ThinkorSwim by Horserider and previous studies
declare lower;

input Show30DayAvg = yes;
input ShowTodayVolume =  yes;
input ShowPercentOf30DayAvg = yes;
input UnusualVolumePercent = 200;
input Show30BarAvg = yes;
input ShowCurrentBar = yes;
input ShowPercentOf30BarAvg = yes;
input ShowSellVolumePercent = yes;
input ShowVolBars = yes;

def O = open;
def H = high;
def C = close;
def L = low;
def V = volume;
def buying = V*(C-L)/(H-L);
def selling = V*(H-C)/(H-L);

def SellVolPercent = Round((Selling / Volume) * 100, 0);

def BV = SellVolPercent is less than 30;
def SV = sellVolPercent is greater than 70;

Plot BuyVol = buying;
BuyVol.setPaintingStrategy(PaintingStrategy.SqUARED_HISTOGRAM);
BuyVol.SetDefaultColor(Color.DARK_GREEN);
BuyVol.HideTitle();
BuyVol.HideBubble();
BuyVol.SetLineWeight(5);



Plot SellVol = selling;
SellVol.setPaintingStrategy(PaintingStrategy.SqUARED_HISTOGRAM);
SellVol.SetDefaultColor(Color.DARK_RED);
SellVol.HideTitle();
SellVol.HideBubble();
SellVol.SetLineWeight(5);

# Total Volume

# Note that Selling + Buying Volume = Volume.
plot TV =  volume;

TV.SetPaintingStrategy(PaintingStrategy.SqUARED_HISTOGRAM);
TV.SetDefaultColor(Color.GRAY);
TV.HideTitle();
TV.HideBubble();
TV.SetLineWeight(5);



#Volume Data

def volLast30DayAvg = (volume(period = "DAY")[1] + volume(period = "DAY")[2] + volume(period = "DAY")[3] + volume(period = "DAY")[4] + volume(period = "DAY")[5] + volume(period = "DAY")[6] + volume(period = "DAY")[7] + volume(period = "DAY")[8] + volume(period = "DAY")[9] + volume(period = "DAY")[10] + volume(period = "DAY")[11] + volume(period = "DAY")[12] + volume(period = "DAY")[13] + volume(period = "DAY")[14] + volume(period = "DAY")[15] + volume(period = "DAY")[16] + volume(period = "DAY")[17] + volume(period = "DAY")[18] + volume(period = "DAY")[19] + volume(period = "DAY")[20] + volume(period = "DAY")[21] + volume(period = "DAY")[22] + volume(period = "DAY")[23] + volume(period = "DAY")[24] + volume(period = "DAY")[25] + volume(period = "DAY")[26] + volume(period = "DAY")[27] + volume(period = "DAY")[28] + volume(period = "DAY")[29] + volume(period = "DAY")[30]) / 30;
def today = volume(period = "DAY");
def percentOf30Day = Round((today / volLast30DayAvg) * 100, 0);
def avg30Bars = (volume[1] + volume[2] + volume[3] + volume[4] + volume[5] + volume[6] + volume[7] + volume[8] + volume[9] + volume[10] + volume[11] + volume[12] + volume[13] + volume[14] + volume[15] + volume[16] + volume[17] + volume[18] + volume[19] + volume[20] + volume[21] + volume[22] + volume[23] + volume[24] + volume[25] + volume[26] + volume[27] + volume[28] + volume[29] + volume[30]) / 30;
def curVolume = volume;
def percentOf30Bar = Round((curVolume / avg30Bars) * 100, 0);

Plot value = if BV then 1 else if SV then -1 else 0;


# Labels

AddLabel(Show30BarAvg, "Avg 30 Bars: " + Round(avg30Bars, 0), CreateColor(69,47,69));

AddLabel(ShowCurrentBar, "Cur Bar: " + curVolume, (if percentOf30Bar >= UnusualVolumePercent then Color.DARK_GREEN else if PercentOf30Bar >= 100 then CreateColor(110,75,110) else Color.DARK_GRAY));

AddLabel(ShowPercentOf30BarAvg, PercentOf30Bar + "%", (if PercentOf30Bar >= UnusualVolumePercent then Color.DARK_GREEN else if PercentOf30Bar >= 100 then CreateColor(110,75,110) else Color.DARK_GRAY) );

AddLabel(ShowSellVolumePercent, "Cur Bar Sell %: " + SellVolPercent, (if SellVolPercent > 70 then Color.RED else if SellVolPercent < 30 then Color.DARK_GREEN else Color.DARK_GRAY));

addlabel(yes, if BV then "*****_BUYING_*****" else if SV then "*****_SELLING_*****" else "", if BV then CreateColor(39,84,130) else if SV then Color.DARK_RED else color.DARK_GRAY);


input lengthV = 20;
plot VolAvg = Average(volume, lengthV);

VolAvg.SetDefaultColor(GetColor(7));

def GreatPercent500 = percentOf30Bar > 500;
def GreatPercent250 = percentOf30Bar > 250;


# hiVolume indicator
# source: http://tinboot.blogspot.com
# author: allen everhart


input type = { default SMP, EXP } ;
input length1 = 20 ;
input hotPct = 100.0 ;

def ma =
if type == type.SMP then
SimpleMovingAvg(volume, lengthV)
else
MovAvgExponential(volume, lengthV);


plot hvBuy250 =
if GreatPercent250 and BV then ma else Double.NaN;



hvBuy250.SetDefaultColor( Color.WHITE);
hvBuy250.SetLineWeight(1) ;
hvBuy250.SetPaintingStrategy( PaintingStrategy.ARROW_UP);


plot hvBuy500 =
if GreatPercent500 and BV then ma else Double.NaN;

hvBuy500.SetDefaultColor( Color.BLACK);
hvBuy500.SetLineWeight(5) ;
hvBuy500.SetPaintingStrategy( PaintingStrategy.ARROW_UP);



plot hvSell250 =
if GreatPercent250 and SV then ma else Double.NaN;



hvSell250.SetDefaultColor( Color.WHITE);
hvSell250.SetLineWeight(1) ;
hvSell250.SetPaintingStrategy( PaintingStrategy.ARROW_DOWN);

plot hvSell500 =
if GreatPercent500 and SV then ma else Double.NaN;



hvSell500.SetDefaultColor( Color.BLACK);
hvSell500.SetLineWeight(5) ;
hvSell500.SetPaintingStrategy( PaintingStrategy.BOOLEAN_ARROw_DOWN);

Link to Chart Study - http://tos.mx/Xa8BW67
 
Last edited:
Several months ago, while messing around with Horseriders RSI indicator, when I added parts of the previous volume indicator, which I tweaked to my liking, I discovered it would display on Range/Renko Charts

The arrows are suppose to signify when volume is 250/500% greater than the 30 day Avg. and the buy vol is greater than 70% for that bar and vice versa for sell Volume. Whether this is actually working correctly on Range/Renko Bars is frankly, beyond me....Looking thru the charts, if used with price action, it does appear to be useful.

Attached is a 3 day ATR chart and a 3 yr ATR Range chart.

VIkcRqW.png


epAaobg.png


The "Sell" label only indicates that the current bars sell volume is greater than 70% and does not indicate that you should actually go short

Note - removed some labels from original volume indicator as they prevented the indicator from displaying on Range/Renko Charts

Code:
#While working with the indicator "RSI Bands and Double RSI SMA Cross Long Term Trades" and the volume study, I inadertently stumpled upon volume working with Range/Renko Bars - RedtoGreen 12/30/2020
#Created by Horserider 7/20/2019
#*RSI code removed*

#Derived from Volume Buy Sell Indicator with Hot Percent for ThinkorSwim by Horserider and previous studies
declare lower;

input Show30DayAvg = yes;
input ShowTodayVolume =  yes;
input ShowPercentOf30DayAvg = yes;
input UnusualVolumePercent = 200;
input Show30BarAvg = yes;
input ShowCurrentBar = yes;
input ShowPercentOf30BarAvg = yes;
input ShowSellVolumePercent = yes;
input ShowVolBars = yes;

def O = open;
def H = high;
def C = close;
def L = low;
def V = volume;
def buying = V*(C-L)/(H-L);
def selling = V*(H-C)/(H-L);

def SellVolPercent = Round((Selling / Volume) * 100, 0);

def BV = SellVolPercent is less than 30;
def SV = sellVolPercent is greater than 70;

Plot BuyVol = buying;
BuyVol.setPaintingStrategy(PaintingStrategy.SqUARED_HISTOGRAM);
BuyVol.SetDefaultColor(Color.DARK_GREEN);
BuyVol.HideTitle();
BuyVol.HideBubble();
BuyVol.SetLineWeight(5);



Plot SellVol = selling;
SellVol.setPaintingStrategy(PaintingStrategy.SqUARED_HISTOGRAM);
SellVol.SetDefaultColor(Color.DARK_RED);
SellVol.HideTitle();
SellVol.HideBubble();
SellVol.SetLineWeight(5);

# Total Volume

# Note that Selling + Buying Volume = Volume.
plot TV =  volume;

TV.SetPaintingStrategy(PaintingStrategy.SqUARED_HISTOGRAM);
TV.SetDefaultColor(Color.GRAY);
TV.HideTitle();
TV.HideBubble();
TV.SetLineWeight(5);



#Volume Data

def volLast30DayAvg = (volume(period = "DAY")[1] + volume(period = "DAY")[2] + volume(period = "DAY")[3] + volume(period = "DAY")[4] + volume(period = "DAY")[5] + volume(period = "DAY")[6] + volume(period = "DAY")[7] + volume(period = "DAY")[8] + volume(period = "DAY")[9] + volume(period = "DAY")[10] + volume(period = "DAY")[11] + volume(period = "DAY")[12] + volume(period = "DAY")[13] + volume(period = "DAY")[14] + volume(period = "DAY")[15] + volume(period = "DAY")[16] + volume(period = "DAY")[17] + volume(period = "DAY")[18] + volume(period = "DAY")[19] + volume(period = "DAY")[20] + volume(period = "DAY")[21] + volume(period = "DAY")[22] + volume(period = "DAY")[23] + volume(period = "DAY")[24] + volume(period = "DAY")[25] + volume(period = "DAY")[26] + volume(period = "DAY")[27] + volume(period = "DAY")[28] + volume(period = "DAY")[29] + volume(period = "DAY")[30]) / 30;
def today = volume(period = "DAY");
def percentOf30Day = Round((today / volLast30DayAvg) * 100, 0);
def avg30Bars = (volume[1] + volume[2] + volume[3] + volume[4] + volume[5] + volume[6] + volume[7] + volume[8] + volume[9] + volume[10] + volume[11] + volume[12] + volume[13] + volume[14] + volume[15] + volume[16] + volume[17] + volume[18] + volume[19] + volume[20] + volume[21] + volume[22] + volume[23] + volume[24] + volume[25] + volume[26] + volume[27] + volume[28] + volume[29] + volume[30]) / 30;
def curVolume = volume;
def percentOf30Bar = Round((curVolume / avg30Bars) * 100, 0);

Plot value = if BV then 1 else if SV then -1 else 0;


# Labels

AddLabel(Show30BarAvg, "Avg 30 Bars: " + Round(avg30Bars, 0), CreateColor(69,47,69));

AddLabel(ShowCurrentBar, "Cur Bar: " + curVolume, (if percentOf30Bar >= UnusualVolumePercent then Color.DARK_GREEN else if PercentOf30Bar >= 100 then CreateColor(110,75,110) else Color.DARK_GRAY));

AddLabel(ShowPercentOf30BarAvg, PercentOf30Bar + "%", (if PercentOf30Bar >= UnusualVolumePercent then Color.DARK_GREEN else if PercentOf30Bar >= 100 then CreateColor(110,75,110) else Color.DARK_GRAY) );

AddLabel(ShowSellVolumePercent, "Cur Bar Sell %: " + SellVolPercent, (if SellVolPercent > 70 then Color.RED else if SellVolPercent < 30 then Color.DARK_GREEN else Color.DARK_GRAY));

addlabel(yes, if BV then "*****_BUYING_*****" else if SV then "*****_SELLING_*****" else "", if BV then CreateColor(39,84,130) else if SV then Color.DARK_RED else color.DARK_GRAY);


input lengthV = 20;
plot VolAvg = Average(volume, lengthV);

VolAvg.SetDefaultColor(GetColor(7));

def GreatPercent500 = percentOf30Bar > 500;
def GreatPercent250 = percentOf30Bar > 250;


# hiVolume indicator
# source: http://tinboot.blogspot.com
# author: allen everhart


input type = { default SMP, EXP } ;
input length1 = 20 ;
input hotPct = 100.0 ;

def ma =
if type == type.SMP then
SimpleMovingAvg(volume, lengthV)
else
MovAvgExponential(volume, lengthV);


plot hvBuy250 =
if GreatPercent250 and BV then ma else Double.NaN;



hvBuy250.SetDefaultColor( Color.WHITE);
hvBuy250.SetLineWeight(1) ;
hvBuy250.SetPaintingStrategy( PaintingStrategy.ARROW_UP);


plot hvBuy500 =
if GreatPercent500 and BV then ma else Double.NaN;

hvBuy500.SetDefaultColor( Color.BLACK);
hvBuy500.SetLineWeight(5) ;
hvBuy500.SetPaintingStrategy( PaintingStrategy.ARROW_UP);



plot hvSell250 =
if GreatPercent250 and SV then ma else Double.NaN;



hvSell250.SetDefaultColor( Color.WHITE);
hvSell250.SetLineWeight(1) ;
hvSell250.SetPaintingStrategy( PaintingStrategy.ARROW_DOWN);

plot hvSell500 =
if GreatPercent500 and SV then ma else Double.NaN;



hvSell500.SetDefaultColor( Color.BLACK);
hvSell500.SetLineWeight(5) ;
hvSell500.SetPaintingStrategy( PaintingStrategy.BOOLEAN_ARROw_DOWN);

Link to Chart Study - http://tos.mx/Xa8BW67
Hi @RedToGreen -great work for those of us who trade Range/Renko Bars. Can you add the Daily Volume and the Avg 30 day Volume as a label on the lower study?
 

young_and_dumb

New member
VIP
very intriguing indicator. Thanks so much for sharing this with us. I trade normal candle bars but the indicators seems really cool!
 

Similar threads

Top