Volume Pressure in a whole new light for ThinkOrSwim

dap711

Active member
VIP
VolumePressure.jpg

I like my indicators to be easy on the eyes and intuitive just by a quick look. So, here is a volume pressure indicator that not only measures the chart asset, but it calculates the Magnificent 7, QQQ, and SPY. When the colors are all the same enter the trade! Can be used on any time frame.


SQL:
declare lower;

# ──────────────────────────────────────────────────────────────────
#  Inputs
# ──────────────────────────────────────────────────────────────────
input PaintBars         = yes;

# Volume Pressure Inputs
input Volume_AvgType    = AverageType.EXPONENTIAL;
input Volume_Length     = 14;
input Volume_AvgLength  = 200;

# Moving Average Inputs
input MovAvg_AvgType    = AverageType.EXPONENTIAL;
input MovAvg_Price      = close;
input MovAvg_Length     = 20;

# ───────────────────────────────────────────────────────────────────────
#  Raw Data
# ───────────────────────────────────────────────────────────────────────
def vol        = volume;
def selling    = vol * (high - close) / (high - low);
def buying     = vol * (close - low) / (high - low);

def buyV_ma   = MovingAverage(Volume_AvgType, buying, Volume_Length);
def sellV_ma  = MovingAverage(Volume_AvgType, selling, Volume_Length);

def MA        = MovingAverage(MovAvg_AvgType, MovAvg_Price, MovAvg_Length);

addlabel(yes, GetSymbol() +": " + round(buyV_ma - sellV_ma,0), if buyV_ma > sellV_ma then color.cyan else color.red);

plot Dot_Cyan = if buyV_ma > sellV_ma and close > MA then 1 else Double.NaN;
Dot_Cyan.SetPaintingStrategy(PaintingStrategy.Histogram);
Dot_Cyan.SetLineWeight(3);
Dot_Cyan.AssignValueColor(Color.CYAN);

plot Dot_Red  = if buyV_ma < sellV_ma and close < MA then 1 else Double.NaN;
Dot_Red.SetPaintingStrategy(PaintingStrategy.Histogram);
Dot_Red.SetLineWeight(3);
Dot_Red.AssignValueColor(Color.RED);

plot pos2Line = 2;
plot pos1Line = 1;
plot ZeroLine = 0;
plot neg1Line = -1;
plot neg2Line = -2;



AssignPriceColor(
    if PaintBars and !IsNaN(Dot_Cyan) then Color.CYAN
    else if PaintBars and !IsNaN(Dot_Red) then Color.RED
    else Color.GRAY
);

# ────────────────────────────────────────────────────────────────────────
#  4) Magnificent Seven aggregate dots at 0/100
# ────────────────────────────────────────────────────────────────────────
script VolumePressure {
    input sym = "AAPL";
    def o = open(sym);
    def h = high(sym);
    def l = low(sym);
    def c = close(sym);
    def v = volume(sym);

    def uw  = if c>o then h-c else h-o;
    def lw  = if c>o then o-l else c-l;
    def sp  = h - l;
    def bd  = sp - (uw + lw);
    def pctB= bd / sp;
    def pctW= (uw + lw) / sp;

    def buyR  = if c>o then (pctB + pctW/2) * v else (pctW/2) * v;
    def sellR = if c<o then (pctB + pctW/2) * v else (pctW/2) * v;

    plot Buy  = MovingAverage(AverageType.EXPONENTIAL, buyR, 14);
    plot Sell = MovingAverage(AverageType.EXPONENTIAL, sellR, 14);
}

def avgBuy  = ( VolumePressure("AAPL").Buy +
                VolumePressure("MSFT").Buy +
                VolumePressure("GOOGL").Buy +
                VolumePressure("AMZN").Buy +
                VolumePressure("META").Buy +
                VolumePressure("TSLA").Buy +
                VolumePressure("NVDA").Buy ) / 7;

def avgSell = ( VolumePressure("AAPL").Sell +
                VolumePressure("MSFT").Sell +
                VolumePressure("GOOGL").Sell +
                VolumePressure("AMZN").Sell +
                VolumePressure("META").Sell +
                VolumePressure("TSLA").Sell +
                VolumePressure("NVDA").Sell ) / 7;

addlabel(yes, "Mag 7: " + round(avgBuy - avgSell,0), if avgBuy > avgSell then color.cyan else color.red);
plot Cyan_M7 = if avgBuy > avgSell then -1 else Double.NaN;
Cyan_M7.SetPaintingStrategy(PaintingStrategy.Histogram);
Cyan_M7.SetLineWeight(3);
Cyan_M7.AssignValueColor(Color.CYAN);
plot Red_M7  = if avgBuy < avgSell then -1 else Double.NaN;
Red_M7.SetPaintingStrategy(PaintingStrategy.Histogram);
Red_M7.SetLineWeight(3);
Red_M7.AssignValueColor(Color.RED);

def qqqBuy  =  VolumePressure("QQQ").Buy;
def qqqSell  =  VolumePressure("QQQ").Sell;
addlabel(yes, "QQQ: " + round(qqqBuy - qqqSell,0), if qqqBuy > qqqSell then color.cyan else color.red);
plot Cyan_QQQ = if qqqBuy > qqqSell then -2 else Double.NaN;
Cyan_QQQ.SetPaintingStrategy(PaintingStrategy.Histogram);
Cyan_QQQ.SetLineWeight(3);
Cyan_QQQ.AssignValueColor(Color.CYAN);
plot Red_QQQ  = if qqqBuy < qqqSell then -2 else Double.NaN;
Red_QQQ.SetPaintingStrategy(PaintingStrategy.Histogram);
Red_QQQ.SetLineWeight(3);
Red_QQQ.AssignValueColor(Color.RED);

def spyBuy  =  VolumePressure("SPY").Buy;
def spySell  =  VolumePressure("SPY").Sell;
addlabel(yes, "SPY: " + round(spyBuy - spySell,0), if spyBuy > spySell then color.cyan else color.red);
plot Cyan_SPY = if spyBuy > spySell then -3 else Double.NaN;
Cyan_SPY.SetPaintingStrategy(PaintingStrategy.Histogram);
Cyan_SPY.SetLineWeight(3);
Cyan_SPY.AssignValueColor(Color.CYAN);
plot Red_SPY  = if spyBuy < spySell then -3 else Double.NaN;
Red_SPY.SetPaintingStrategy(PaintingStrategy.Histogram);
Red_SPY.SetLineWeight(3);
Red_SPY.AssignValueColor(Color.RED);

VolumePressure.jpg
 
Last edited:

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

I noticed something on the NQ 1-minute chart (October 14th, 2025). At 12:11 PM, the price bar was painted cyan even though the histogram stack showed cyan/red/red/red. It looks like the bar color defaults to whichever histogram color is active for the first (top) histogram layer from 0 to 1.

I’ve also seen cases where the bar turns gray when that top histogram is neutral (gray), even if lower layers show clear directional bias. Thought I’d mention it in case the paint logic is intended to reflect the full stack (consensus-based) rather than just the first histogram.
 
Last edited:
A picture is worth a thousand words. :)

The asset is measured with a moving average:
Code:
# Moving Average Inputs
input MovAvg_AvgType = AverageType.EXPONENTIAL;
input MovAvg_Price = close;
input MovAvg_Length = 20;

So if volume pressure is a buy but the closing price is below the MA .. you get a gray bar. Vice-versa for sell.

All of the stacks are calculated individually, so the only relation I look for is confluence.

(rare glimpse of my chart setup)
My chart setup.jpg
 
Last edited by a moderator:
I noticed something on the NQ 1-minute chart (October 14th, 2025). At 12:11 PM, the price bar was painted cyan even though the histogram stack showed cyan/red/red/red.
Not all assets move with the market. Sometimes, a stock will be a buy when the market is selling off. This is a good time to leave that stock alone and find another to trade. Unless you like to gamble?

BTW .. thanks for taking the indicator out for a spin! I think if you use it for a while, you will see why this is one of my favorites and on all of my charts.
 
Last edited:
A picture is worth a thousand words. :)

The asset is measured with a moving average:
Code:
# Moving Average Inputs
input MovAvg_AvgType = AverageType.EXPONENTIAL;
input MovAvg_Price = close;
input MovAvg_Length = 20;

So if volume pressure is a buy but the closing price is below the MA .. you get a gray bar. Vice-versa for sell.

All of the stacks are calculated individually, so the only relation I look for is confluence.

(rare glimpse of my chart setup)
View attachment 26139
Thanks for sharing. Your MY_Fusion indicator looks interesting. Would you mind sharing the the script or what it entails? Thanks in advance
 
A picture is worth a thousand words. :)

The asset is measured with a moving average:
Code:
# Moving Average Inputs
input MovAvg_AvgType = AverageType.EXPONENTIAL;
input MovAvg_Price = close;
input MovAvg_Length = 20;

So if volume pressure is a buy but the closing price is below the MA .. you get a gray bar. Vice-versa for sell.

All of the stacks are calculated individually, so the only relation I look for is confluence.

(rare glimpse of my chart setup)
View attachment 26139
Hi @dap771, thanks for the volume pressure indicator. I have it on my chart and it seems to be helpful in making a decision to get in or stay out of trades. What are the three other lower indicators (specifically the one name My Fusion)? It'll be great if you can share it.
 
Last edited:
Hi @dap771, thanks for the volume pressure indicator. I have it on my chart and it seems to be helpful in making a decision to get in or stay out of trades. What are the three other lower indicators (specifically the one name My Fusion)? It'll be great if you can share it.
I did share it, and it was moved to the VIP indicators by the moderators.

I guess they really liked it as well. :)
 
Thanks for sharing. Your MY_Fusion indicator looks interesting. Would you mind sharing the the script or what it entails? Thanks in advance
Hi @dap771, thanks for the volume pressure indicator. I have it on my chart and it seems to be helpful in making a decision to get in or stay out of trades. What are the three other lower indicators (specifically the one name My Fusion)? It'll be great if you can share it.

Yes, the Fusion - Unified Signal For ThinkOrSwim is an excellent indicator.
Because it used the VIP smoothing code in its creation; it is only available on the VIP Forums.
VIP members can find out more and join in on the discussion on the VIP forum:
https://usethinkscript.com/threads/fusion-unified-signal-for-thinkorswim.21711/
 
View attachment 25972
I like my indicators to be easy on the eyes and intuitive just by a quick look. So, here is a volume pressure indicator that not only measures the chart asset, but it calculates the Magnificent 7, QQQ, and SPY. When the colors are all the same enter the trade! Can be used on any time frame.


SQL:
declare lower;

# ──────────────────────────────────────────────────────────────────
#  Inputs
# ──────────────────────────────────────────────────────────────────
input PaintBars         = yes;

# Volume Pressure Inputs
input Volume_AvgType    = AverageType.EXPONENTIAL;
input Volume_Length     = 14;
input Volume_AvgLength  = 200;

# Moving Average Inputs
input MovAvg_AvgType    = AverageType.EXPONENTIAL;
input MovAvg_Price      = close;
input MovAvg_Length     = 20;

# ───────────────────────────────────────────────────────────────────────
#  Raw Data
# ───────────────────────────────────────────────────────────────────────
def vol        = volume;
def selling    = vol * (high - close) / (high - low);
def buying     = vol * (close - low) / (high - low);

def buyV_ma   = MovingAverage(Volume_AvgType, buying, Volume_Length);
def sellV_ma  = MovingAverage(Volume_AvgType, selling, Volume_Length);

def MA        = MovingAverage(MovAvg_AvgType, MovAvg_Price, MovAvg_Length);

addlabel(yes, GetSymbol() +": " + round(buyV_ma - sellV_ma,0), if buyV_ma > sellV_ma then color.cyan else color.red);

plot Dot_Cyan = if buyV_ma > sellV_ma and close > MA then 1 else Double.NaN;
Dot_Cyan.SetPaintingStrategy(PaintingStrategy.Histogram);
Dot_Cyan.SetLineWeight(3);
Dot_Cyan.AssignValueColor(Color.CYAN);

plot Dot_Red  = if buyV_ma < sellV_ma and close < MA then 1 else Double.NaN;
Dot_Red.SetPaintingStrategy(PaintingStrategy.Histogram);
Dot_Red.SetLineWeight(3);
Dot_Red.AssignValueColor(Color.RED);

plot pos2Line = 2;
plot pos1Line = 1;
plot ZeroLine = 0;
plot neg1Line = -1;
plot neg2Line = -2;



AssignPriceColor(
    if PaintBars and !IsNaN(Dot_Cyan) then Color.CYAN
    else if PaintBars and !IsNaN(Dot_Red) then Color.RED
    else Color.GRAY
);

# ────────────────────────────────────────────────────────────────────────
#  4) Magnificent Seven aggregate dots at 0/100
# ────────────────────────────────────────────────────────────────────────
script VolumePressure {
    input sym = "AAPL";
    def o = open(sym);
    def h = high(sym);
    def l = low(sym);
    def c = close(sym);
    def v = volume(sym);

    def uw  = if c>o then h-c else h-o;
    def lw  = if c>o then o-l else c-l;
    def sp  = h - l;
    def bd  = sp - (uw + lw);
    def pctB= bd / sp;
    def pctW= (uw + lw) / sp;

    def buyR  = if c>o then (pctB + pctW/2) * v else (pctW/2) * v;
    def sellR = if c<o then (pctB + pctW/2) * v else (pctW/2) * v;

    plot Buy  = MovingAverage(AverageType.EXPONENTIAL, buyR, 14);
    plot Sell = MovingAverage(AverageType.EXPONENTIAL, sellR, 14);
}

def avgBuy  = ( VolumePressure("AAPL").Buy +
                VolumePressure("MSFT").Buy +
                VolumePressure("GOOGL").Buy +
                VolumePressure("AMZN").Buy +
                VolumePressure("META").Buy +
                VolumePressure("TSLA").Buy +
                VolumePressure("NVDA").Buy ) / 7;

def avgSell = ( VolumePressure("AAPL").Sell +
                VolumePressure("MSFT").Sell +
                VolumePressure("GOOGL").Sell +
                VolumePressure("AMZN").Sell +
                VolumePressure("META").Sell +
                VolumePressure("TSLA").Sell +
                VolumePressure("NVDA").Sell ) / 7;

addlabel(yes, "Mag 7: " + round(avgBuy - avgSell,0), if avgBuy > avgSell then color.cyan else color.red);
plot Cyan_M7 = if avgBuy > avgSell then -1 else Double.NaN;
Cyan_M7.SetPaintingStrategy(PaintingStrategy.Histogram);
Cyan_M7.SetLineWeight(3);
Cyan_M7.AssignValueColor(Color.CYAN);
plot Red_M7  = if avgBuy < avgSell then -1 else Double.NaN;
Red_M7.SetPaintingStrategy(PaintingStrategy.Histogram);
Red_M7.SetLineWeight(3);
Red_M7.AssignValueColor(Color.RED);

def qqqBuy  =  VolumePressure("QQQ").Buy;
def qqqSell  =  VolumePressure("QQQ").Sell;
addlabel(yes, "QQQ: " + round(qqqBuy - qqqSell,0), if qqqBuy > qqqSell then color.cyan else color.red);
plot Cyan_QQQ = if qqqBuy > qqqSell then -2 else Double.NaN;
Cyan_QQQ.SetPaintingStrategy(PaintingStrategy.Histogram);
Cyan_QQQ.SetLineWeight(3);
Cyan_QQQ.AssignValueColor(Color.CYAN);
plot Red_QQQ  = if qqqBuy < qqqSell then -2 else Double.NaN;
Red_QQQ.SetPaintingStrategy(PaintingStrategy.Histogram);
Red_QQQ.SetLineWeight(3);
Red_QQQ.AssignValueColor(Color.RED);

def spyBuy  =  VolumePressure("SPY").Buy;
def spySell  =  VolumePressure("SPY").Sell;
addlabel(yes, "SPY: " + round(spyBuy - spySell,0), if spyBuy > spySell then color.cyan else color.red);
plot Cyan_SPY = if spyBuy > spySell then -3 else Double.NaN;
Cyan_SPY.SetPaintingStrategy(PaintingStrategy.Histogram);
Cyan_SPY.SetLineWeight(3);
Cyan_SPY.AssignValueColor(Color.CYAN);
plot Red_SPY  = if spyBuy < spySell then -3 else Double.NaN;
Red_SPY.SetPaintingStrategy(PaintingStrategy.Histogram);
Red_SPY.SetLineWeight(3);
Red_SPY.AssignValueColor(Color.RED);

View attachment 25972
@dap711 Looks very useful. Would you kindly point me to a more detailed explanation as I am trying to understand this indicator but came up short. A simple illustrated example will help greatly. Perhaps just one buy scenario.
1. There are the 3 colors on the chart. Are we to map this to the lower study for consistency which indicates volume support?
2. How do you use the 4 labels UUUU etc?
3. What else is one supposed to look for?
 
@dap711 Looks very useful. Would you kindly point me to a more detailed explanation as I am trying to understand this indicator but came up short. A simple illustrated example will help greatly. Perhaps just one buy scenario.
1. There are the 3 colors on the chart. Are we to map this to the lower study for consistency which indicates volume support?
2. How do you use the 4 labels UUUU etc?
3. What else is one supposed to look for?

📘 Volume Pressure Indicator — User Guide
1. Overview

The Volume Pressure Indicator measures the directional force of buying and selling volume inside each candle and combines it with a trend filter and market regime overlays (Mag 7, QQQ, SPY).
It helps you determine:
  • Who is in control (buyers vs sellers)
  • Whether the trend has real volume behind it
  • Whether your stock is aligned with broader market strength or weakness
  • When to take or avoid trades based on multi-layer confirmation
This indicator works on any timeframe and is especially effective for intraday equity trading (24/5).


2. What the Indicator Shows
A. Symbol Pressure (Your Charted Symbol)

This appears at the +1 level in the lower panel.
  • Cyan Histogram (bullish pressure)
    • Buying volume EMA > Selling volume EMA
    • Price above 20-EMA
      → Confidence: buyers in control AND trend supports it.
  • Red Histogram (bearish pressure)
    • Selling volume EMA > Buying volume EMA
    • Price below 20-EMA
      → Confidence: sellers in control AND trend supports it.
B. Price Bar Coloring
Your price candles are auto-painted:
  • Cyan = confirmed buying pressure
  • Red = confirmed selling pressure
  • Gray = neutral or mixed pressure
C. Market Regime Rows
These appear below your main symbol:
RowAssetMeaning
-1Mag 7 (AAPL, MSFT, GOOGL, AMZN, META, TSLA, NVDA)Mega-cap leadership pressure
-2QQQNasdaq 100 volume pressure
-3SPYBroad market volume pressure
Cyan = net buying.
Red = net selling.
Each also displays a numerical pressure label.


3. How Pressure Is Calculated
For every candle:
  • Buying Pressure = volume × (close – low) / (high – low)
  • Selling Pressure = volume × (high – close) / (high – low)
These are smoothed using 14-period EMAs to reduce noise.
For Mag7/QQQ/SPY additional logic splits volume across body/wicks to more accurately measure true buy/sell participation.


4. How to Use the Indicator
A. Trade Only in the Direction of Confirmed Pressure
Long (Buy) Conditions
Look for:
  1. Your symbol shows cyan pressure (Dot_Cyan)
  2. Price is above the 20-EMA
  3. At least Mag7 or QQQ is also cyan
  4. Ideally SPY is also cyan (broad market confirmation)
Best Setup:
Symbol cyan + Mag7 cyan + QQQ cyan → Strongest probability.


Short (Sell/Put) Conditions
Look for:
  1. Your symbol shows red pressure (Dot_Red)
  2. Price is below the 20-EMA
  3. Mag7 or QQQ also red
  4. Better if SPY red too
Best Setup:
Symbol red + Mag7 red + QQQ red → Strong bearish alignment.


B. Entry Strategy
Trend-Follow Entry (most consistent)
For longs:
  1. Market regime (Mag7/QQQ) showing cyan.
  2. Your symbol had prior cyan bars.
  3. Price pulls back toward 20-EMA (bars may turn gray or light red).
  4. Enter when your symbol returns to cyan with a confirming candle.
Mirror this for shorts in red.


C. Avoid Trades During “Mixed Pressure”
If your symbol is cyan but:
  • Mag7 is red
  • QQQ is red
  • SPY is red
→ Don’t take the trade.
The broader market is not supporting your direction.
Same for red on your symbol but green markets.


D. Spotting Regime Shifts
Regime shifts occur when:
  • Mag7 flips red → cyan or
  • QQQ flips red → cyan
These often mark the start of a new trend or momentum surge.
The first pullback after a regime shift is usually the highest-quality entry.


5. Recommended Timeframes
  • 1-minute / 5-minute: Fast scalping
  • 5-minute / 15-minute: Intraday
  • 30-minute / 1-hour: Swing trading
  • Daily: Position trading or macro confirmation
Indicator adapts cleanly to all.


6. Practical Tips
✔ If everything is cyan → Market wants to move up
✔ If everything is red → Market wants to move down
✔ If your stock is opposite the regime → High odds of fakeout
✔ Use pressure flips to find early reversals
✔ Use pressure alignment to find trend continuation entries

7. Signals Cheat Sheet
Strongest Long
  • Symbol: Cyan
  • Mag7: Cyan
  • QQQ: Cyan
  • SPY: Cyan
  • Price > 20EMA
Weak Long / Avoid
  • Symbol: Cyan
  • Mag7: Red OR QQQ: Red
  • Trend conflict = likely whipsaw
Strongest Short
  • Symbol: Red
  • Mag7: Red
  • QQQ: Red
  • SPY: Red
  • Price < 20EMA
Weak Short / Avoid
  • Symbol: Red
  • Mag7 cyan (especially QQQ cyan)

8. What This Indicator Does Better Than Others
  • Confirms directional volume, not just raw volume
  • Filters trades using trend + volume agreement
  • Adds institutional flow context via Mag7/QQQ/SPY
  • Shows market health at a glance
  • Eliminates many bad trades caused by trading against the regime

9. One-Sentence Summary
This indicator tells you when your stock AND the market have aligned buying or selling pressure so you only trade when real money is moving in your direction.
 
Last edited by a moderator:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
703 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