Market Breadth Indicators
for Algo Trading
TRIN, TICK, advance-decline, 52-week highs and lows, percent above moving average, and the sentiment surveys: what each one quantifies, how to add them to Build Alpha's no-code strategy engine, and 90 custom breadth signals to download.
What is Market Breadth?
Market Breadth is a general term for any technical analysis indicator that attempts to quantify the strength or weakness of a stock market index by the aggregate participation among the index's components. Market Breadth is an attempt to "look under the hood" of the stock market index to gauge the market's health. A healthy market, in theory, should have sustained price trends.
Market Breadth indicators can be tremendous additions to trading systems that focus on price action. Price action alone may not provide the entire picture and market breadth can add this much needed context to trading systems.
Is this rally broad based and going to last, or are investors flocking to a few safe haven names? Market Breadth can help influence trading system positioning and hopefully eradicate a few false positive signals.
Market Breadth Indicators
Build Alpha includes market breadth indicators alongside the existing 7,000+ pre-built signals. In this article I will explain the main market breadth indicators, what they quantify, and how to add them to the Build Alpha no code strategy engine (genetic algorithm).
- TRIN
- TICK
- NYSE Advance Decline Ratio
- Number of 52 Week Highs
- Number of 52 Week Lows
- Percent of SP500 Stocks Above SMA
- Percent of SP500 Stocks Below SMA
TRIN or Arms Index
TRIN is a short-term indicator that compares the number of advancing and declining stocks to the advancing and declining volume. Originally created by Richard W. Arms, Jr. with the intent of gauging volatility in the stock market, TRIN can provide insights into market strength.
In theory, a rising TRIN indicates a weak market while a falling TRIN indicates a strong market. A value below 1 is considered bullish and above 1 is bearish. However, please test EVERYTHING.
Calculating TRIN
- TRIN = (Advancing Stocks / Declining Stocks) / (Advancing Volume / Declining Volume)
where:
- Advancing Stocks = number of stocks higher on the day
- Declining Stocks = number of stocks lower on the day
- Advancing Volume = total volume of all advancing stocks
- Declining Volume = total volume of all declining stocks
Using TRIN with Build Alpha
TRIN is in the Market Breadth signal category and can be directly searched. Typical TRIN readings range from 0 to +2 with extremes above 2.
Build Alpha built-in TRIN signals, all optimizable:
- above or below a specific value
- crosses above or below a value
- above or below n-bars ago
- above or below a moving average

NYSE TICK Index
The TICK Index compares the number of stocks rising on the New York Stock Exchange with those that are falling. In this case, a rising stock is defined as a stock where liquidity is being removed; that is, trading on or above the offer. A falling stock is trading at the bid or below.
There are approximately 2,800 stocks listed on the NYSE and if 1,500 traded on the offer and 1,300 traded on the bid then the TICK reading would be +200 (1,500 minus 1,300).
Using TICK with Build Alpha
TICK is in the Market Breadth signal category and is directly searchable. Typical values range from -1000 to +1000.
Build Alpha built-in TICK signals, all optimizable:
- above or below a specific value
- crosses above or below a value
- above or below n-bars ago
- above or below a moving average

NYSE Advance Decline Difference
The AD Line or NYSE Advance/Decline Line is another breadth indicator calculated by taking the difference between the number of advancing and declining issues.
Using NYSE Adv/Dec with Build Alpha
NYSE Adv-Decl Diff is located in the Market Breadth signal category and directly searchable. Values range from -3,000 to +3,000.
Build Alpha built-in NYSE Adv-Decl Diff signals, all optimizable:
- above or below a specific value
- crosses above or below a value
- above or below n-bars ago
- above or below a moving average

52 Week High Stocks and 52 Week Low Stocks
A count of S&P 500 stocks making new 52-week highs and a count of S&P 500 stocks making new 52-week lows is also available. This reading can show how widespread the market involvement is. A stock index making new highs without broad participation can indicate where or what market participants believe about the current rally.
Using 52 Week Highs and 52 Week Lows with Build Alpha
No. 52Wk Highs and No. 52Wk Lows are in the Market Breadth category and directly searchable. Values range from 0 to 500; however, it is rare to see values north of 300 for either indicator.
An Idea
Requiring one to be high and the other to be low may provide a different market regime as opposed to them both being near each other in value. Different ways to quantify the market environment!
Build Alpha built-in No. 52Wk Highs and No. 52Wk Lows signals, all optimizable:
- above or below a specific value
- crosses above or below a value
- above or below n-bars ago
- above or below a moving average

Percentage of SP500 Stocks above Simple Moving Average
Tracking the percentage of stocks above their respective moving average can serve as an overall health assessment. More stocks above their moving averages means fewer investors underwater and (theoretically) less pressure to sell.
On the other hand, if all or most stocks are below their moving average then there may be no sellers left and one can investigate market exhaustion (bottom) signals.
Using Percent of SP500 above or below SMA with Build Alpha
Percent SP500 Abv SMA signals are in the Market Breadth signal category and directly searchable. There are different signal groups for the 20-day, 50-day, and 200-day moving average. Since the values are a percentage, they range from 0 to 100.
Build Alpha built-in Percent SP500 Abv SMA and Percent SP500 Bel SMA signals, all optimizable:
- above or below a specific value
- crosses above or below a value
- above or below n-bars ago
- above or below a moving average

Does Breadth Predict Tomorrow's Range?
Quick analysis shows the daily percentage of S&P 500 stocks above their 20-day SMA against the next session's ES range, March 2010 through September 2026, 4,099 sessions.

Sorting sessions into quintiles makes the shape obvious. When fewer stocks are above their 20-day average, tomorrow's range is wider, and the lowest quintile roughly doubles the rest:
| % above 20-day SMA quintile | Sessions | Mean next-day range | Range ÷ prior 20-day ATR |
|---|---|---|---|
| Q1 (lowest breadth) | 820 | 2.23% | 1.28x |
| Q2 | 823 | 1.41% | 1.11x |
| Q3 | 820 | 1.15% | 1.01x |
| Q4 | 816 | 1.07% | 0.90x |
| Q5 (highest breadth) | 820 | 1.15% | 0.80x |

It Is Not Just Recent Volatility
A fair objection: breadth collapses after volatile days, and volatility clusters. Measured relative to the prior 20-day ATR instead of in raw percent, the lowest-breadth quintile still ranges 1.28 times normal against 0.80 times for the highest, and the rank correlation barely moves (−0.38). Short-term breadth carries information about tomorrow's range that yesterday's volatility alone does not.
It Holds in Every Sub-Period

The gap is about the same size in each era, including the most recent one, which is what you want to see before building on a relationship.
What This Means for Strategy Design
Use short-term breadth to size the expected move. Low breadth is the environment for breakout entries, wider stops and targets, and smaller position size. High breadth is the environment for tighter targets and fading extremes. Pair the breadth condition with your entry logic.
Method Notes
ES continuous contract, session close to session close, range measured as (high − low) divided by the prior close. The breadth reading is the daily value Build Alpha ships, read at the close and compared to the following session. The continuous contract is back-adjusted, so prices were de-adjusted with anchor points before computing percentages; the ATR-relative figures are unaffected by that adjustment.
Market Sentiment
Market Sentiment is the overall investor attitude or investor attention toward the anticipated future price movement of a particular security or market index. In short, it is a numeric representation of how investors feel about where the market is headed.
Market sentiment can range between extreme bearishness and extreme bullishness. How investors feel can be valuable information for how likely a certain price action signal or trading system may fare.
Kresimir Penavic, an applied mathematics PhD from Renaissance Technologies (the best hedge fund ever, founded by Jim Simons) has a great quote in The Man Who Solved the Market regarding sentiment:
"What you're really modeling is human behavior," explains Penavic, the researcher. "Humans are most predictable in times of high stress. They act instinctively and panic. Our entire premise was that human actors will react the way humans did in the past. We learned to take advantage."
Human sentiment, behavior, and high stress seem like valuable inputs to trading systems. What if you built one only when... anyways.
Sentiment Trading
Build Alpha includes a handful of sentiment indicators that traders can test and include in trading systems. Let's investigate a few below.
AAII Investor Sentiment
The AAII Sentiment Survey asks individual investors their opinion on market direction six months out and has been doing so since 1987. The American Association of Individual Investors (AAII) surveys participants and the returning votes are classified as bullish, neutral, or bearish. The survey is conducted weekly and is made available Thursday morning.
The website is very cool and provides a nice snapshot for the current week.

Using AAII Sentiment with Build Alpha
AAII Sentiment is found in the Market Breadth signal category and is directly searchable. The values range from extreme bearishness to extreme bullishness with a scale from 0 to 100. Build Alpha provides the bullish, neutral, and bearish values separately.
Build Alpha built-in AAII Sentiment signals, all optimizable:
- above or below a specific value
- crosses above or below a value
- above or below n-bars ago
- above or below a moving average

NAAIM Exposure Index
The National Association of Active Investment Managers Exposure Index represents the average exposure to US equities reported by its members. The association states "the index provides insights into the actual adjustments active risk managers have made to client accounts over the past two weeks." The index is updated on Thursday mornings.
The range of responses are:
- 200% Leveraged Short
- 100% Fully Short
- 0% (100% cash or hedged to market neutral)
- 100% Fully Long
- 200% Leveraged Long
Then NAAIM returns the average of all responses as well as the deviation, both of which are available in Build Alpha.
The NAAIM Exposure Index can be thought of in a similar vein as the Commitment of Traders Report.
Using NAAIM with Build Alpha
NAAIM Exposure Index is found in the Market Breadth signal category and is directly searchable. The values can range from -200 to 200.
Build Alpha built-in NAAIM Exposure Index signals, all optimizable:
- above or below a specific value
- crosses above or below a value
- above or below n-bars ago
- above or below a moving average

Google Trends
Google Trends shows how frequently people are searching certain keywords. Build Alpha pulls data directly from Google from 2004 to present day for 15 popular keywords such as:
Spikes in web traffic for keywords such as Recession, Bear Market, Market Crash, or Buy Gold may indicate increased fear. On the other hand, spikes in web traffic for keywords like best stocks to buy, day trading, or options trading may signal a frothy market with extra retail participation. Finally, spikes in search volume for unemployment benefits, inflation, etc. may signal warning signs that the economy is not doing as well as recent numbers suggest.
Below you can see a plot of how search volume spiked for the keyword Recession around the 2020 Covid lows and again around the 2022 inflation scare lows.

Dark Pool Index
The Dark Index (DIX) is a dollar-weighted measure of the Dark Pool Indicator on S&P 500 components that measures the dark pool short volume as reported by FINRA in its Reg SHO daily files. The calculation is short off-exchange volume divided by all off-exchange volume. The indicator was first published in the SqueezeMetrics documentation.
The DIX creator states: "Because it rises and falls without regard to price, volatility, or gamma, it provides an uncorrelated signal that frequently tracks sentiment, whether or not that sentiment has been reflected in price."
Using Dark Pool Index with Build Alpha
Dark Index is found in the Market Breadth signal category and is directly searchable. The values are a percentage of all off-exchange volume and scaled 0 to 100.
Build Alpha built-in Dark Pool Index signals, all optimizable:

Custom Market Breadth Signals: 90 Signals in 8 Families
The built-in templates above cover levels, crosses, and moving averages. The custom file goes further: percentile ranks over 252 periods, ratios and spreads between related series, and momentum in the readings themselves. I built 90 of them, organized by data source. Every threshold and lookback is a parameter you can optimize in Build Alpha.
TRIN_Above_1_5TRIN is above 1.5, indicating relatively heavy downside pressure.TRIN_Below_0_7TRIN is below 0.7, indicating relatively strong upside pressure.TRIN_Above_90thPctTRIN's 252-period percentile rank is above 90.TRIN_Below_PriorTRIN is lower than its previous reading.
TICK_Above_1000TICK is above +1000, indicating unusually broad simultaneous buying.TICK_Below_Neg1000TICK is below -1000, indicating unusually broad simultaneous selling.TICK_Above_MaxPrior2TICK is greater than both of its previous two readings.TICK_Below_MinPrior2TICK is below both of its previous two readings.
ADD_Above_0NYSE Advance-Decline Difference is positive.ADD_Below_0NYSE Advance-Decline Difference is negative.ADD_Above_90thPctAdvance-Decline Difference is above its 90th percentile rank over 252 periods.ADD_Below_10thPctAdvance-Decline Difference is below its 10th percentile rank over 252 periods.
High52_Above_90thPctNumber of 52-week highs is in its top 10% of readings over 252 periods.High52_Above_SMA20Number of 52-week highs is above its 20-period average.Low52_Above_90thPctNumber of 52-week lows is in its top 10% of readings over 252 periods.Low52_Above_SMA20Number of 52-week lows is above its 20-period average.High52_Above_PriorMore stocks are making 52-week highs than on the prior period.Low52_Below_PriorFewer stocks are making 52-week lows than on the prior period.High52_Above_Low52More stocks are making 52-week highs than 52-week lows.High52_Above_2xLow5252-week highs are more than twice 52-week lows.Low52_Above_2xHigh5252-week lows are more than twice 52-week highs.HighLowSpread_WideningThe difference between 52-week highs and lows is increasing.High52_Low52_Ratio_Above_SMA2052-week highs/lows ratio is above its own 20-period average.High52_Low52_Ratio_Below_SMA2052-week highs/lows ratio is below its own 20-period average.
PctUp_Above_70More than 70% of S&P 500 stocks are up.PctUp_Above_90thPctPercent of stocks up is in its top 10% of readings over 252 periods.PctDown_Above_70More than 70% of S&P 500 stocks are down.PctDown_Above_90thPctPercent of stocks down is in its top 10% of readings over 252 periods.PctUp_Above_PriorPercentage of stocks up is higher than on the prior period.PctDown_Below_PriorPercentage of stocks down is lower than on the prior period.PctUp_Above_PctDownMore S&P 500 stocks are up than down.PctUp_Above_2xPctDownPercentage of stocks up is more than twice percentage down.PctDown_Above_2xPctUpPercentage of stocks down is more than twice percentage up.PctUpDownSpread_WideningThe difference between % up and % down is increasing.PctUp_PctDown_Ratio_Above_SMA20% stocks up / % stocks down is above its own 20-period average.PctUp_PctDown_Ratio_Below_SMA20% stocks up / % stocks down is below its own 20-period average.
ABV20_Above_80More than 80% of S&P 500 stocks are above their SMA20.ABV20_Below_20Fewer than 20% of S&P 500 stocks are above their SMA20.ABV20_Above_PriorShort-term breadth is improving versus the prior period.ABV20_Above_50More than half of S&P 500 stocks are above their SMA20.ABV50_Above_80More than 80% of S&P 500 stocks are above their SMA50.ABV50_Below_20Fewer than 20% of S&P 500 stocks are above their SMA50.ABV50_Above_PriorIntermediate-term breadth is improving versus the prior period.ABV50_Above_50More than half of S&P 500 stocks are above their SMA50.ABV200_Above_80More than 80% of S&P 500 stocks are above their SMA200.ABV200_Below_20Fewer than 20% of S&P 500 stocks are above their SMA200.ABV200_Above_PriorLong-term breadth is improving versus the prior period.ABV200_Above_50More than half of S&P 500 stocks are above their SMA200.ABV20_ABV50_Ratio_Above_SMA20ABV20/ABV50 is above its own 20-period average.ABV20_ABV50_Ratio_Below_SMA20ABV20/ABV50 is below its own 20-period average.ABV20_ABV50_Spread_WideningABV20 minus ABV50 is increasing.ABV20_ABV50_Spread_NarrowingABV20 minus ABV50 is decreasing.ABV20_ABV200_Ratio_Above_SMA20ABV20/ABV200 is above its own 20-period average.ABV20_ABV200_Ratio_Below_SMA20ABV20/ABV200 is below its own 20-period average.ABV20_ABV200_Spread_WideningABV20 minus ABV200 is increasing.ABV20_ABV200_Spread_NarrowingABV20 minus ABV200 is decreasing.ABV50_ABV200_Ratio_Above_SMA20ABV50/ABV200 is above its own 20-period average.ABV50_ABV200_Ratio_Below_SMA20ABV50/ABV200 is below its own 20-period average.ABV50_ABV200_Spread_WideningABV50 minus ABV200 is increasing.ABV50_ABV200_Spread_NarrowingABV50 minus ABV200 is decreasing.
Bulls_Above_50AAII Bulls is above 50%.Bulls_Above_90thPctAAII Bulls is in its top 10% of readings over 252 periods.Bulls_Below_PriorAAII Bulls is lower than its prior reading.Bears_Above_50AAII Bears is above 50%.Bears_Above_90thPctAAII Bears is in its top 10% of readings over 252 periods.Bears_Below_PriorAAII Bears is lower than its prior reading.Neutral_Above_90thPctAAII Neutral is in its top 10% of readings over 252 periods.Neutral_Below_10thPctAAII Neutral is in its bottom 10% of readings over 252 periods.Bulls_Above_BearsAAII Bulls is greater than AAII Bears.Bears_Above_BullsAAII Bears is greater than AAII Bulls.BullBearSpread_WideningBulls minus Bears is increasing versus the prior reading.BullBearSpread_NarrowingBulls minus Bears is decreasing versus the prior reading.Bulls_Bears_Ratio_Above_SMA20Bulls/Bears is above its own 20-period average.Bulls_Bears_Ratio_Below_SMA20Bulls/Bears is below its own 20-period average.Bulls_Bears_Ratio_Above_90thPctThe Bulls/Bears ratio is in its top 10% of readings over 252 periods.Bulls_Bears_Spread_NarrowingBulls minus Bears is decreasing versus the prior reading.Bulls_Neutral_Ratio_Above_SMA20Bulls/Neutral is above its own 20-period average.Bulls_Neutral_Ratio_Below_SMA20Bulls/Neutral is below its own 20-period average.Bulls_Neutral_Spread_WideningBulls minus Neutral is increasing.Bulls_Neutral_Spread_NarrowingBulls minus Neutral is decreasing.Bears_Neutral_Ratio_Above_SMA20Bears/Neutral is above its own 20-period average.Bears_Neutral_Ratio_Below_SMA20Bears/Neutral is below its own 20-period average.Bears_Neutral_Spread_WideningBears minus Neutral is increasing.Bears_Neutral_Spread_NarrowingBears minus Neutral is decreasing.
NAAIM_Above_80NAAIM exposure is above 80.NAAIM_Below_20NAAIM exposure is below 20.NAAIM_Above_90thPctNAAIM is in its top 10% of readings over 252 periods.NAAIM_Below_10thPctNAAIM is in its bottom 10% of readings over 252 periods.NAAIM_Above_PriorNAAIM exposure is higher than its prior reading.NAAIM_Below_PriorNAAIM exposure is lower than its prior reading.
CustomIndicators.xml, back into your BuildAlpha folder.How Else to Use Market Breadth Signals
Build Alpha can use Market Breadth (actually any) signals as either:
- Entry Signal
- A filter to turn a strategy ON/OFF
Let's explore some other creative ways to use Market Breadth and Sentiment signals.
Combine Market Breadth with Price Action
The simplest place to start is to combine market breadth with price action signals. Build Alpha has signals for:
- Comparing OHLC values
- Candlesticks
- Quantified Chart Patterns
- Math manipulations to OHLC values
- Consecutive Higher or Lower
- Technical Analysis Indicators
- And More
The important question to ask is, does market breadth or sentiment affect the effectiveness of a price action pattern my trading system is using? If so, does the market breadth or sentiment signal warrant inclusion into my system?
If you do not know, then I suppose there is work to do!
Combine Market Breadth with Non-Price Based Signals
Build Alpha has other useful non-price based signals that can add context and help communicate the market environment to trading systems.
Treasury Yields and Spreads
It is often stated that the Bond Market is smarter than the Stock Market. Build Alpha has signals dedicated to the entire yield curve as well as common spreads such as the 2s10s spread which when negative has predicted (or preceded) every recession from 1955 to present day.

Here are the signals available for the 10-2s yield curve depicted above.

Volatility Index (VIX) Term Structure
Volatility Index Futures can give insights into how traders view risk in the near-term and longer-term. If front-month VIX futures are trading higher than the back of the curve (futures with a farther expiration date) then the VIX term structure is said to be inverted. Inversion implies that investors now view risks greater in the near term than risks in the future, which should sound alarming because volatility should increase with the square root of time as time increases.

Build Alpha supports VIX signals across the entire curve as well as a few quantified metrics of the curve itself to capture contango or backwardation.

A quick visual showing how tomorrow's S&P 500 Futures returns fare depending on the inversion of the VIX Term Structure (negative values means more inverted):

Gamma Exposure
Gamma Exposure (GEX) is a dollar-denominated measure of option market-makers' hedging obligations. In short, it is a ratio measuring the gamma of all the call option open interest to the gamma of all the put option open interest.
This calculation is typically done on the SPX index or on the individual stock components of SPX.
A positive or high gamma value will act as a brake on prices and as an accelerator when GEX is low or negative. Below you can see how SPX returns gyrate when GEX dips negative, which can ultimately affect how your trading system performs.

Build Alpha includes GEX signals on the SPX index as well as GEX calculated on the components under the Options Data signal category. Typical ranges are defined in the Signal Glossary / User Guide that accompanies the license. For the full breakdown and 36 custom GEX signals, see the Gamma Exposure guide.

Commitment of Traders Report (COT Report)
The commitment of traders report is a weekly report released by the CFTC that discloses open interest or market positioning among the top 20 or so futures markets and options on futures markets.
The report is broken into three groups of traders: Commercials (hedgers), non-commercials (large speculators), and nonreportables (small speculators). The commercials and non-commercials are often referred to as "smart money" while the nonreportables are often considered the "dumb money" or retail crowd.
Build Alpha includes COT report signals for 15+ markets and counting, and all values are represented as a percentage of total open interest.

To read more and see a COT report strategy please check out the Commitment of Traders Report Trading Strategy Idea post.

Combine Market Breadth with News Event Trading
How does the market respond to a Nonfarm Payroll miss while investor sentiment is weak? How about when investor sentiment is strong? These questions should be investigated for successful trading. Build Alpha has all news event dates and economic values to test.
Read the full guide to see how trading systems can trade (or avoid) news event releases: News Event Trading with Build Alpha.
Combine Market Breadth with Intermarket Analysis
The final point worth making is that most of the market breadth signals are stock market breadth signals; however, these can still be valuable to trading systems focusing on other markets such as Gold, Treasuries, or even commodities. I wrote more about Intermarket Analysis in this post but wanted to explicitly clarify that one can use these Market Breadth signals with any asset, timeframe, or bar type in Build Alpha.
Final Thoughts
A longer post than I anticipated, but there is a lot to do in Build Alpha. Market Breadth and Sentiment signals can provide much needed context for price action strategies and investment ideas. My motto is and always will be TEST EVERYTHING! And because of that I will continue to add new data sets, signals, and tests to Build Alpha. I hope these Market Breadth signals help.
Thanks for reading,
Dave
Market Breadth FAQ

David Bergstrom
The guy behind Build Alpha. I have spent a decade-plus in the professional trading world working as a market maker and quantitative strategy developer at a high frequency trading firm with a Chicago Mercantile Exchange (CME) seat, consulting for Hedge Funds, Commodity Trading Advisors (CTAs), Family Offices, and Registered Investment Advisors (RIAs). I am a self-taught programmer utilizing C++, C#, and Python with a statistics background specializing in data science, machine learning, and trading strategy development. I have been featured on Chatwithtraders.com, Bettersystemtrader.com, Desiretotrade.com, Quantocracy, Traderlife.com, Seeitmarket.com, Benzinga, TradeStation, NinjaTrader, and more. Build Alpha is the culmination of a repeatable process to find, create, test, and implement algorithmic trading ideas in a robust manner. Please reach out to me directly at any time.
What Traders Say About Build Alpha


















Explore More
Trade with Participation Context
Breadth and sentiment data built in. 90 custom signals. Point-and-click strategies for any market. No coding required.