Index Breadth Percent of Stocks above Key Moving Averages
Sep 10, 2022

The Index Breadth Percent of Stocks above Key Moving Averages indicator tracks the percentage of stocks within a specific index or sector trading above their key moving averages to identify internal market strength and overextended conditions. By monitoring these breadth metrics, traders can effectively determine when a market is reaching overbought (Greed) or oversold (Fear) levels relative to its historical participation.
Usage
The Usage section describes how the script can be used to gauge market sentiment through breadth analysis. Users can select from a wide range of indices including the S&P 500, Nasdaq 100, and Dow Jones Industrial Average, as well as specific S&P 500 sectors like Financials, Energy, or Technology.
Traders typically use this tool to find extremes in market participation:
- Greed Zone: When the percentage of stocks above a selected moving average (e.g., the 200-day DMA) exceeds the Greed Level (default 80%), it suggests the market may be overextended and due for a consolidation or pullback.
- Fear Zone: When the percentage drops below the Fear Level (default 20%), it indicates a lack of participation and potential capitulation, often signaling a buying opportunity or a market bottom.
- Divergence: If the price of an index is making new highs while the percentage of stocks above a key moving average is declining, it suggests weakening internal support for the trend.
Details
The script utilizes the request.security function to fetch breadth data for various market tickers. Each combination of market index and Daily Moving Average (DMA) corresponds to a specific internal breadth ticker. For example, selecting the S&P 500 with a 50-day DMA pulls data for "S5FI", while the 200-day DMA pulls "S5TH".
The indicator supports five standard moving average lookbacks: 20, 50, 100, 150, and 200 days. Shorter lookbacks (20, 50) are more sensitive and useful for short-term swing trading, while longer lookbacks (150, 200) are better suited for identifying major cyclical tops and bottoms.
Settings
- Select Market: Choose the specific index or S&P 500 sector to analyze (e.g., Overall Market, Nasdaq, Russell 2000, SP500 Energy).
- Select DMA: Set the moving average period (20, 50, 100, 150, or 200) used to calculate the percentage of stocks trading above their average.
- Select Greed Level: Define the upper threshold (default 80) that signifies an overbought or "Greed" state.
- Select Fear Level: Define the lower threshold (default 20) that signifies an oversold or "Fear" state.
FAQ
How do I interpret the colored zones on the chart? The green highlighted areas represent the "Fear Zone" (below the fear level), indicating high potential for a reversal upward. Red highlighted areas represent the "Greed Zone" (above the greed level), indicating potential exhaustion.
Can I set alerts for specific market conditions? Yes, the script includes built-in alert conditions that trigger when the breadth line enters or exits the defined Greed and Fear zones.
How do I access the Index Breadth Percent of Stocks above Key Moving Averages indicator? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.
Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.
Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.
As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.
Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.
Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.
This does not represent our full Disclaimer. Please read our full disclaimer.
© 2026 LuxAlgo Global, LLC.

