# https://www.reddit.com/r/thewallstreet/comments/7wiyvf/a_beginners_guide_to_market_internals/
Advance/Decline Difference and Ratio - $ADDC (NYSE), $ADSPDC (S&P) or $ADQDC (NQ)
This internal shows you the total number of advancing vs declining stocks in the NYSE or Nasdaq Composite. If 1800 stocks are positive for the day and 500 are down, you'll get a reading of 1300. Since there are a limited number of stocks in the composites, this metric has a cap.
The $ADDC and the ratio of advancing ($ADVN) to declining ($DECN) issues give us market breadth. If the Nasdaq is up today, how many stocks are pushing it up? Is it a broad-based rally or is a green day the result of only a small portion of the market. Naturally, you will likely find choppier days closer to 0. Rallies and steep drops will begin to pull more and more stocks up/down as the day wears on. This is the most basic indicator here and forms the basis for the subject at hand.
A reading of +800 or so means stocks are advancing roughly 2 to 1, which can be a good signal. The inverse is true for bearish conditions, but anything too close to 0 is no signal at all.
Since these two have charts, it is useful to see how things change over time. Because we cannot get a chart of the a/d ratio it is more useful as a number. Thus, the following script:
Advance/Decline Ratio Thinkscript
Here's a little gift. I only later realized Thinkorswim's advance/decline is a study, but we can get a simple number output with this that fits on any chart as a green/red label for bullish/bearish conditions and use it for any of the major indexes. For the mathematically challenged, 1.3 basically means 30% more stocks are advancing today vs declining in that index, while a reading as low as 0.3 means only 30% of stocks are advancing. I used composites as they include the data from all exchanges. Rip off the C in the code for these symbols if you for some reason want only the main source (if so tell me why!).
REMOVE THE (#) SIGN IN FRONT OF THE LINE YOU WANT TO USE.
#Use this if you want to see the ratio as a study beneath your chart, then copy the others you need.
#declare lower;
#Switch any below def to plot to see the NYSE Composite advance decline ratio as a chart. Def will give us the label
#def adratio = close("$ADVNC") / close("$DECNC");
#Addlabel(yes, adratio + " Adv/Dec", if adratio >= 1 then color.green else color.red);
#Uncomment the below to show Nasdaq Composite Advance Decline
#def adrationasdaq = close("$ADVNC/Q") / close("$DECNC/Q");
#Addlabel(yes, adrationasdaq + " Adv/Dec NQ", if adrationasdaq >= 1 then color.green else color.red);
#Uncomment below to show S&P 500 Composite Advance Decline
#def adratiosp = close("$ADVSPC") / close("$DECLSPC");
#Addlabel(yes, adratiosp + " Adv/Dec S&P", if adratiosp >= 1 then color.green else color.red);
#All 3 can be used together if you like, and will show separate labels. You can also find the advance decline info for the Russell and Dow, just swap the symbols in or copy one of the script blocks.
As for using this, I want to know how broad a rally is. Is this thing really going to break out, or am I about to get whipsawed by a shitty market that's almost 50/50? It's no good on its own but in combination with the next one can be a pretty damned big clue as to whether we will have a trending day.
Volume Difference and Totals - $VOLDC $VOLSPDC and $VOLNDDC
These two show the total difference in volume going into stocks advancing vs those declining. Unlike the Advance Declinne Ratio it is immensely useful to view as a chart itself because on a really bloody day, or a strong rally, the numbers will grow relatively from one day to another. It is useful to know what type of volume has been seen in the market recently.
$UVOL and $DVOL show the amounts separately - throw a /Q or SP on the end to get this for the nasdaq or S&P by themselves. It is important to note that these are a cumulative total, but it can go down. This is because a stock in the down volume category can move to the up volume category when it goes green for the day. Its cumulative volume is subtracted from the dvol category and added to the uvol category as a result of its improved status.
You choose which of these is right for you - either the pairing of UVOL and DVOL or the simple difference by itself. If you use the difference, you can plot a 0 line in your trading software to easily see when it is positive vs negative. Numbers can range into the billions here so it's useful to do this. Here's how in thinkorswim. Make a simple study and name it zeroline and you can use it in anything like this:
plot zeroline = 0;