Working Volume Indicator for Range/Renko Bars

RedToGreen

Active member
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:

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

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?
 
very intriguing indicator. Thanks so much for sharing this with us. I trade normal candle bars but the indicators seems really cool!
 
Hello Traders,
A friend provided me with this volume study. It works just fine and it does a pretty decent job at measuring volume on any timeframe. However, I would like to know if it any of you guys could modify the code so it works on renko/range bars. If not, any suggestions for a volume indicator that works for renko/range bars based on the actual ticks [timestamp] would be much appreciated. Stay safe out there.

#私はあなたがこれを翻訳するためにグーグル翻訳を使用していると思います。私の息子はお疲れ様でした
#구글 번역기를 사용하여 번역하신 것 같습니다. 잘했어 내 아들아
#我猜你正在使用谷歌翻译来翻译这个。干得好我的儿子
# ;)

Code:
declare lower;

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);

# Selling Volume
Plot SV = selling;
SV.setPaintingStrategy(PaintingStrategy.Histogram);
SV.SetDefaultColor(Color.Red);
SV.HideTitle();
SV.HideBubble();
SV.SetLineWeight(5);

# Buying Volume
# Plot BV = Buying;
# Note that Selling + Buying Volume = Volume.
Plot BV = volume;
BV.setPaintingStrategy(PaintingStrategy.Histogram);
BV.SetDefaultColor(Color.Dark_Green);
BV.HideTitle();
BV.HideBubble();
BV.SetLineWeight(5);

#Inputs
input Show30DayAvg = yes;
input ShowTodayVolume = yes;
input ShowPercentOf30DayAvg = yes;
input UnusualVolumePercent = 200;
input Show30BarAvg = yes;
input ShowCurrentBar = yes;


#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 = VolumeAvg(30).VolAvg;
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;


# Labels
AddLabel(Show30DayAvg, "Daily Avg: " + Round(volLast30DayAvg, 0), Color.LIGHT_GRAY);
AddLabel(ShowTodayVolume, "Today: " + today, (if percentOf30Day >= UnusualVolumePercent then Color.GREEN else if percentOf30Day >= 100 then Color.ORANGE else Color.LIGHT_GRAY));
 
Last edited by a moderator:
Hello Traders,
A friend provided me with this volume study. It works just fine and it does a pretty decent job at measuring volume on any timeframe. However, I would like to know if it any of you guys could modify the code so it works on renko/range bars. If not, any suggestions for a volume indicator that works for renko/range bars based on the actual ticks [timestamp] would be much appreciated. Stay safe out there.
@AnimalMother I moved your post here as it seems related to your question. See post#1 and read through this short thread about Renko and volume.
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
239 Online
Create Post

Similar threads

Similar threads

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