OPEN-SOURCE SCRIPT

ASX 200 Breadth - % Above MA

287
ASX 200 Breadth - % Above MA

Overview
This indicator measures market breadth for the ASX 200 by tracking the percentage of a representative basket of 40 large- and mid-cap ASX-listed stocks trading above a chosen moving average. It helps gauge whether strength (or weakness) in the index is broad-based across the market or concentrated in just a handful of large stocks.

How It Works
- Pine Script limits a single indicator to 40, so true 200-stock breadth isn't possible directly. Instead, this script uses a diversified 40-stock sample spanning the major ASX sectors:
- Financials: CBA, NAB, WBC, ANZ, MQG, SUN, QBE, IAG, ASX
- Materials/Resources: BHP, RIO, FMG, S32, NEM, STO, WDS
- Healthcare: CSL, RMD, COH, SHL, PME
- Consumer: WES, WOW, COL, TWE, JHX, AMC
- Industrials/Infrastructure: TCL, APA, BXB, CPU
- Property (REITs): GMG, SCG, MGR, VCX
- Tech/Other: XRO, REA, ALL, ORG
- For each stock, the script checks whether the current closing price is above its 20-, 50-, 100-, and 200-period Simple Moving Average (SMA).
- The indicator then plots the percentage of the basket trading above each selected MA, e.g. a reading of 75% on the 50-day line means 30 of the 40 sample stocks are above their 50-day SMA.

Inputs

- MA to Display: Choose which breadth line(s) to show - 20, 50, 100, 200, or All (shows all four together). Default: All
- Overbought Level: Upper reference line - readings above this suggest broad-based strength / potential overextension. Default: 80
- Oversold Level: Lower reference line - readings below this suggest broad-based weakness / potential capitulation. Default: 20

Reading the Indicator
- **Above 50%**: more than half the sample is trending above the selected MA — generally bullish breadth.
- **Below 50%**: more than half the sample is trending below the selected MA — generally bearish breadth.
- **Near 80%+ (Overbought)**: market strength is broad and stretched — watch for breadth divergences if price keeps rising but this line rolls over.
- **Near 20% or below (Oversold)**: broad-based weakness — often associated with capitulation lows or the start of a recovery once breadth turns back up.
- **Divergences**: if the ASX 200 index makes a new high/low but breadth fails to confirm (doesn't reach a corresponding extreme), it can signal weakening participation behind the move.
- **Multiple timeframes ("All")**: comparing the 20-day line against the 100/200-day lines shows whether short-term moves are aligned with the longer-term trend — e.g., a sharp pop in the 20-day line while the 200-day line stays low suggests a short-term bounce within a longer downtrend.

Notes & Limitations
- This is a **sample-based proxy** for ASX 200 breadth, not an exact count across all 200 constituents — actual index breadth may differ, especially when small-caps move independently of large-caps.
- All four MA lengths are calculated from a single data request per stock, so adding more MA options does not increase the symbol count or hit Pine's 40-symbol request limit.
- Works on any timeframe — the moving averages are calculated on that chart's timeframe (e.g., daily MAs on a daily chart, weekly MAs on a weekly chart).

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.