$VOLD Divergence Indicator for ThinkorSwim

BenTen

Administrative
Staff member
Staff
VIP
Lifetime
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:

john3

Active member
2019 Donor
@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.
 

Charles

New member
Lifetime
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.
 

BenTen

Administrative
Staff member
Staff
VIP
Lifetime
@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).
 

BenTen

Administrative
Staff member
Staff
VIP
Lifetime
@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.
 

tdvayreda

New member
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
 

we29125

Member

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:

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.
Top