Volume Pressure in a whole new light for ThinkOrSwim

Thank you for getting back with me. I'm new to this. If I'm using a wrong version, what version do you recommend? If you have something better, that would be great, if you are willing to post it.
 
Thank you for getting back with me. I'm new to this. If I'm using a wrong version, what version do you recommend? If you have something better, that would be great, if you are willing to post it.

Use the code from this post. Here
Read how to use it. Here

I use this indicator to trade stocks in the NASDAQ and I mostly trade QQQ.
 
@dap711 Thanks for this, I"ll start testing this more. I had a very marginal hope, that maybe we could use this on SPX charts, since that Volume can't be used on indexes directly. Since this aggregates based on SPY, QQQ, was hoping it'd be different. But it doesn't work unfortunately. Have you found any other way for getting sorta volume on SPX?
 
@dap711 Thanks for this, I"ll start testing this more. I had a very marginal hope, that maybe we could use this on SPX charts, since that Volume can't be used on indexes directly. Since this aggregates based on SPY, QQQ, was hoping it'd be different. But it doesn't work unfortunately. Have you found any other way for getting sorta volume on SPX?
I've got you covered .. This was posted a month ago, right here in this thread! Click here
 
I've got you covered .. This was posted a month ago, right here in this thread! Click here
I like your buy/sell vol. pressure indicator very much as a lower study and am wondering if there a way to have it not paint the upper price bars in any way. I tried turning off this feature in the settings but then the price bars become grayed out. Thanks much for all your effort.
 
I like your buy/sell vol. pressure indicator very much as a lower study and am wondering if there a way to have it not paint the upper price bars in any way. I tried turning off this feature in the settings but then the price bars become grayed out. Thanks much for all your effort.

Yup ..

Find this code:
C#:
AssignPriceColor(
    if PaintBars and !IsNaN(Dot_Cyan) then Color.CYAN
    else if PaintBars and !IsNaN(Dot_Red) then Color.RED
    else Color.GRAY
);

And replace it with this code:
C#:
AssignPriceColor(
    if PaintBars and !IsNaN(Dot_Cyan) then Color.CYAN
    else if PaintBars and !IsNaN(Dot_Red) then Color.RED
    else Color.CURRENT
);

Cheers!
Dwain
 
Thank you for building this. It is very useful!

Question on how it computes... I noticed when I have a chart of QQQ up, the numbers are different than the built in QQQ... why is that?

VOL PRESSURE.PNG
 
Thank you for building this. It is very useful!

Question on how it computes... I noticed when I have a chart of QQQ up, the numbers are different than the built in QQQ... why is that?

View attachment 27120
Because they are calculated differently. :)

There are several ways to calculate volume pressure. The chart uses the most common way and the others use my way. Neither are the "correct" way and it gives me a way to compare if looking at QQQ or SPY.
 
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 YOU ARE ONE SHARP COOKIE..THANKS FOR THIS SCRIPT..
I am struggling with getting my ahk just right on the project you did for the color trader using the boxes in the upper left hand corner of the screen.. Any chance you will share a copy of the aht that you used to set tuem up.. and or even the study you used to control the result. If i could get it working with a single simple study i have a lot of ideas for it.. and will be happy to share if i come up with any ideas of great studies that work well with it.. Thanks you are good..
 
Last edited by a moderator:
@dap711 YOU ARE ONE SHARP COOKIE..THANKS FOR THIS SCRIPT..
I am struggling with getting my ahk just right on the project you did for the color trader using the boxes in the upper left hand corner of the screen.. Any chance you will share a copy of the aht that you used to set tuem up.. and or even the study you used to control the result. If i could get it working with a single simple study i have a lot of ideas for it.. and will be happy to share if i come up with any ideas of great studies that work well with it.. Thanks you are good..
When I get a minute, I'll put together a strategy with labels and a scan using this indicator, complete with instructions. I'll bump this thread when I start a new one. Heads up, you can't use my logic for the Mag 7 in a scan, so it won't match the indicator exactly.
 

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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