PROTECTED SOURCE SCRIPT

Universe Breadth Engine & Trend Scorecard [StockBee Style]

10
Description
Concept & Methodology Traders are often misled by market-cap weighted indices (like SPY or QQQ). When a handful of mega-cap stocks rally, the index may look healthy even if the majority of stocks are selling off. This is called a "Hollow Rally."

This script is designed to look "under the hood" of the US Stock Market. It aggregates data from the entire investable universe (combining both NASDAQ and NYSE internals) to determine the true strength of market participation. It draws heavy inspiration from the StockBee Market Monitor methodology, using breadth and moving average geometry to define "Safe" vs. "Unsafe" trading environments.

How It Works (The Math)

This indicator combines three distinct layers of market analysis into a single pane:

1. The "Universe" McClellan Oscillator Most breadth indicators only look at one exchange. This script aggregates data to create a "Total US Market" view:

Data aggregation: We sum Advancing Issues (USI:ADVN.NQ + USI:ADVN.NY) and subtract Declining Issues (USI:DECL.NQ + USI:DECL.NY).

The Calculation: We apply the standard McClellan Oscillator formula to this aggregated net number: (19-period EMA of Net Issues) - (39-period EMA of Net Issues).

The Signal Line: A 5-period Simple Moving Average (SMA) of the Oscillator.

Green Line: Breadth momentum is rising (5SMA > Previous 5SMA).

Red Line: Breadth momentum is falling.

2. The Market Monitor Filter (Background Color) To determine the long-term "Health" of the market, the script queries the Wilshire 5000 index breadth (INDEX:MMTH), which represents the total US stock universe.

Logic: It measures the percentage of stocks currently above their 50-Day Moving Average.

Green Background: The percentage is rising (Current % > 10-Day SMA of %). This indicates an expanding environment.

Red Background: The percentage is falling. This indicates a contracting environment.

3. The "Traffic Light" Ribbon (Bottom Line) A thick ribbon at the bottom of the pane visualizes the trend of the QQQ (Nasdaq 100 Equal Weighted).

Green Ribbon: Price is above both the 10-day and 20-day SMAs.

Gray Ribbon: Price has lost the short-term moving average structure.

4. The Breadth Scorecard (Table) The table on the right provides a statistical summary of "Winning Days" (Positive Breadth) vs "Losing Days" (Negative Breadth) over multiple timeframes:

7 Days & 30 Days: For short-term momentum checks.

3 Month, 6 Month, 1 Year: For secular trend analysis.

YTD: Year-to-Date performance.

How to Use This Tool

The "All Clear" Signal: When the Background is Green (Market Monitor rising), the Ribbon is Green (Price Trend), and the Oscillator Bars cross above the Signal Line. This suggests high-probability conditions for long swing trades.

Divergence Warning: If the QQQ is making new highs, but the Oscillator is making lower highs (or staying red), it indicates that the rally is not supported by the broader market.

The Turnaround: A crossover of the Oscillator above the Signal Line while deep in negative territory often marks a short-term sold-out low.

Settings & Customization

Fully Configurable Table: You can change the position, size, and colors of the Scorecard table to fit your chart layout.

Data Sources: The script uses USI and INDEX tickers by default. These can be adjusted in the settings if you use different data providers.

Disclaimer: This tool is for educational market analysis only and does not constitute financial advice.

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.