$VOLD Divergence Indicator for ThinkorSwim

BenTen

Administrative
Staff member
Staff
VIP
Lifetime
Volume divergence is a powerful yet nuanced tool for traders, especially when it comes to spotting possible trend reversals or continuations. Here’s a quick rundown of the pros and cons to keep in mind:

Pros:​

  1. Early Warning Signals: Volume divergence often acts as an early alert to shifts in market sentiment. For example, if price rises but volume decreases, it can signal a weakening trend.
  2. Improves Accuracy: Used alongside technical indicators like moving averages or support and resistance levels, volume divergence helps validate trend strength and spot entry or exit points.
  3. Insight into Market Sentiment: By watching volume trends relative to price movements, traders gain a window into the confidence or hesitation of other market participants, which can be highly valuable in predicting price behavior.

Cons:​

  1. Not Always Reliable: Volume divergence isn’t foolproof and can sometimes produce false signals, leading traders to anticipate a reversal or continuation that doesn’t materialize.
  2. Requires Context: Volume divergence works best in the context of other indicators. Without additional confirmation, it’s easy to misinterpret volume signals, especially in choppy or low-volume markets.
  3. Complex for Beginners: Interpreting volume divergence accurately can take time and practice, making it challenging for new traders who may still be mastering technical analysis basics.
While volume divergence isn’t perfect, it can add depth to a trader's analysis toolkit, offering insights into potential shifts in market direction. Used carefully, it can be a valuable part of any trading strategy.


$VOLD Divergence Indicator for ThinkorSwim
Here is an indicator that shows divergences between $VOLD and $SPY. A divergence happen when the price disagree with an indicator or an index. In this case, it's the $VOLD index. VOLD is the difference between the up volume and down volume on the NYSE.

How to trade:
  • When the price of SPY is going up while $VOLD is heading lower, we have a bearish divergence = short
  • When the price of SPY is going down while $VOLD is heading higher, we have a bullish divergence = long
You don't need an indicator for this, just create a side-by-side chart in ThinkorSwim and have both tickers on display. Or you can use the following indicator and only need to have one chart. Pick whichever works best for you.

I put this indicator together so that I can quickly check for divergences all in one chart.

thinkScript Code

Code:
# VOLD and SPY Divergences
# Assembled by BenTen at useThinkScript.com
# Discussion https://usethinkscript.com/threads/vold-divergence-indicator-for-thinkorswim.715/

declare lower;

input symbol_1 = "SPY";
def IsUp = close > open;
def IsDown = close < open;
def U = close("$UVOL");
def D = close("$DVOL");
def UDL = U - D;

plot volume;
def volume_confirm = UDL > UDL[5];
def volume_confirm2 = UDL > UDL[5];

volume.SetPaintingStrategy(paintingStrategy.SQUARED_HISTOGRAM);
volume.assignValueColor(if volume_confirm then Color.green else Color.red);

if (GetUnderlyingSymbol() == symbol_1)
{
  volume =  UDL;
}
else
{
  volume = double.nan;
}

AddLabel(yes,"SPY Only", color.white);

assignPriceColor(if volume_confirm then color.green else color.red);

Here's how it works:

The direction of the candles is based on $SPY. The color of the candles is based on $VOLD. If you see SPY moving down, but the candles remains green, then there is a possible bullish divergence. Same goes for when SPY is moving up, but the candles are red, there is a potential bearish divergence.

msvJEfW.png

hKX11gg.png

V12KxeG.png

5Ys0Ogr.png


This method is just one way of utilizing the market internals to trade. I heard some people also use $ADD and $TICK. Here's a quick overview of Market Internals.
 
Last edited by a moderator:
@BenTen Would you please include the URL of the thread in the study's header. Just makes it easier to go back to it if needed. Thank you.
 
I like this indicator, but was wondering if it would be useful to color the divergent bars a different color. For example, a divergent green bar would be colored a lighter shade of red and a divergent red bar a lighter shade of green. This would keep the divergent trend easy to see, but give a bit more information.
 
@Charles You would still have to identify the divergence on your own. The coloring just suggest that there might be a divergence. See the examples I provided. SPY going up but the candles are red (this suggest there might be a bearish divergence).
 
@tdvayreda Pine script and thinkScript are two different language. It won't work out of the box. You will need to convert it to pinescript.
 
Thank you for this quick response. One more question? Is there a program to convert this script? Or do I have to write it myself in pinescript?
Tnx
 

Would this code work ? @BenTen

Code:
# $TICK and SPY Divergences
# Assembled by BenTen at useThinkScript.com
# Discussion https://usethinkscript.com/threads/vold-divergence-indicator-for-thinkorswim.715/

declare lower;

input symbol_1 = "SPY";
def IsUp = close > 0;
def IsDown = close < 0;
def UDL = close("$TICK");

plot volume;
def volume_confirm = UDL > UDL[5];

volume.SetPaintingStrategy(paintingStrategy.SQUARED_HISTOGRAM);
volume.assignValueColor(if volume_confirm then Color.green else Color.red);

if (GetUnderlyingSymbol() == symbol_1)
{
  volume =  UDL;
}
else
{
  volume = double.nan;
}

AddLabel(yes,"SPY Only", color.white);

assignPriceColor(if volume_confirm then color.green else color.red);
 
Last edited:

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

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
278 Online
Create Post

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