Okay, so the most talked about and often most underutilized indicator we have is volume. And I get it, tos gives us beautiful candles and then gives us this boring volume chart underneath as if its an afterthought. So you probably guessed by now, I love pretty volume charts.
Think about all the different types of volume driven price action we get:
It could tell us:
Enjoy!
mod note:
Think about all the different types of volume driven price action we get:
- A ton of small orders comes in with above average volume but the price stays flat
- A few large orders come in and push the price up 1-ATR
- A mix of large and small orders come in and the price goes parabolic
- A mix of large and small orders come in and the stock dumps
It could tell us:
- A large institution is buying up shares quietly, because of the large order they have chosen to break it down into smaller sizes to avoid driving up the price
- Some rich retail investor heard their uncle talk about a new product line about to drop an its going to change the industry
- A, executive order comes out of the white house to shift us away from solar and into nuclear tech for "energy security"
- The company misses earnings and not only is everyone piling out but algorithms and stop losses are triggering
Enjoy!
mod note:
The ToS data feeds do not provide true buyers and sellers volume.
read here for how the amazing @Jman831 created the original indicator:
https://usethinkscript.com/threads/...e-pressure-for-thinkorswim.11739/#post-101477

Code:
declare lower;
###############################################################################
# CONFIGURABLE PARAMETERS
###############################################################################
input Deviation_Length = 60;
input Deviate = 2;
input Show_Labels = yes;
input Audible_Alert = yes;
input Show_Arrows = yes;
input UseVWAPFilter = yes;
# ---------- Anchored VWAP controls ----------
input UseDateAnchor = no; # YES = anchor to a fixed calendar date
input AnchorDate = 20250102; # yyyymmdd (ignored when UseDateAnchor = no)
input AnchorTime = 0930; # hhmm bar that starts VWAP
input ResetEachSession = yes; # only matters when UseDateAnchor = no
# ---------- Regular-hours window ----------
input RTHOpen = 0930; # hhmm — change if needed
input RTHClose = 1600; # hhmm
###############################################################################
# VOLUME CONTEXT
###############################################################################
def volumeStDev = RelativeVolumeStDev(length = Deviation_Length);
def abovedev = volumeStDev >= Deviate;
def increase = volume > volume[1];
def decrease = volume < volume[1];
def devincrease = increase and abovedev;
def devdecrease = decrease and abovedev;
###############################################################################
# BUYING vs. SELLING VOLUME
###############################################################################
def O = open;
def H = high;
def C = close;
def L = low;
def V = volume;
def Buying = if H != L then V * (C - L) / (H - L) else 0;
def Selling = if H != L then V * (H - C) / (H - L) else 0;
###############################################################################
# >>> ANCHORED VWAP – REGULAR-HOURS ONLY <<<
###############################################################################
def isIntraday = GetAggregationPeriod() < AggregationPeriod.DAY;
# regular-session flag (true for every bar on daily/weekly charts)
def RTH = if isIntraday
then SecondsFromTime(RTHOpen) >= 0 and SecondsTillTime(RTHClose) > 0
else 1;
# --- decide which bar(s) restart the VWAP ---
def dateHit = GetYYYYMMDD() == AnchorDate;
def timeHit = SecondsFromTime(AnchorTime) == 0;
def barIsAnchor = (UseDateAnchor and dateHit and timeHit) # single date/time
or (!UseDateAnchor and timeHit); # daily open style
def newSession = GetDay() <> GetDay()[1];
def resetVWAP = barIsAnchor
or ( (!UseDateAnchor) and ResetEachSession and newSession );
# --- running sums advance ONLY in RTH, reset when resetVWAP is true ---
def cumPV = CompoundValue(
1,
if resetVWAP then C * V
else if RTH then cumPV[1] + C * V
else cumPV[1],
C * V);
def cumVol = CompoundValue(
1,
if resetVWAP then V
else if RTH then cumVol[1] + V
else cumVol[1],
V);
def anchoredVWAP = if cumVol != 0 then cumPV / cumVol else Double.NaN;
def aboveVWAP = C > anchoredVWAP;
def belowVWAP = C < anchoredVWAP;
###############################################################################
# VOLUME PLOTS
###############################################################################
plot SV = Selling;
SV.AssignValueColor(if devdecrease then Color.PINK else Color.RED);
SV.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
SV.SetLineWeight(5);
plot BV = Buying;
BV.AssignValueColor(if devincrease then Color.LIGHT_GREEN else CreateColor(0,165,0));
BV.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
BV.SetLineWeight(5);
###############################################################################
# RELATIVE STRENGTH METRICS
###############################################################################
def buyPct = if Buying + Selling != 0 then Buying / (Buying + Selling) else 0;
def sellPct = 1 - buyPct;
###############################################################################
# SIGNAL CONDITIONS
###############################################################################
def bigBuy = devincrease and buyPct > 0.7;
def bigSell = devdecrease and sellPct > 0.7;
###############################################################################
# ALERTS
###############################################################################
Alert(bigBuy and Audible_Alert, "Heavy Buying Surging", Alert.BAR, Sound.Ding);
Alert(bigSell and Audible_Alert, "Heavy Selling Dump", Alert.BAR, Sound.Bell);
###############################################################################
# ARROW SIGNALS
###############################################################################
plot BuyArrow = Show_Arrows and bigBuy and (UseVWAPFilter == no or aboveVWAP);
BuyArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
BuyArrow.SetDefaultColor(Color.GREEN);
plot SellArrow = Show_Arrows and bigSell and (UseVWAPFilter == no or belowVWAP);
SellArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
SellArrow.SetDefaultColor(Color.RED);
###############################################################################
# LABELS
###############################################################################
AddLabel(Show_Labels,
"Buy Vol = " + Round(Buying, 0) +
(if devincrease then " 🚀 Big Surge" else ""),
if Buying > Selling then Color.GREEN else Color.DARK_GRAY);
AddLabel(Show_Labels,
"Buy %: " + Round(buyPct * 100, 1) + "%" +
(if buyPct > 0.7 then " | Buyers in Control"
else if buyPct < 0.3 then " | Sellers Dominating"
else " | Neutral"),
if buyPct > 0.7 then Color.LIGHT_GREEN
else if buyPct < 0.3 then Color.RED
else Color.GRAY);
AddLabel(Show_Labels,
"Sell Vol = " + Round(Selling, 0) +
(if devdecrease then " 🔻 Major Dump" else ""),
if Selling > Buying then Color.RED else Color.DARK_GRAY);
AddLabel(Show_Labels,
"Sell %: " + Round(sellPct * 100, 1) + "%" +
(if sellPct > 0.7 then " | Heavy Selling"
else if sellPct < 0.3 then " | Light Selling"
else " | Mixed"),
if sellPct > 0.7 then Color.PINK
else if sellPct < 0.3 then Color.GRAY
else Color.LIGHT_GRAY);
AddLabel(Show_Labels,
"VWAP " +
(if UseDateAnchor
then "(" + AnchorDate + " " + AnchorTime + ")"
else "(Daily " + AnchorTime + ")")
+ " = " + Round(anchoredVWAP, 2) +
(if aboveVWAP then " | Above" else " | Below"),
if aboveVWAP then Color.GREEN else Color.RED);
Last edited: