Updated

Global Market Strength and Breadth Stance

1 520
Introduction

The Market Strength and Breadth Dashboard is a comprehensive, institutional-grade market monitoring tool designed for swing traders and active investors. Instead of trading in a vacuum, this dashboard scans the internal health of a chosen market across cap sizes, sector leaders, equal-weighted indices, and growth/value proxies. By analyzing multiple dimensions of trend strength and rolling them up into a live dashboard, the indicator calculates an overall Market Stance and provides actionable guidance on Total Open Risk (TOR).

Whether you trade in the US, India, Japan, China, Taiwan, or South Korea, this dashboard provides a top-down view of market breadth so you can trade with the wind at your back.

https://www.tradingview.com/x/qw2AWRpv/

Key Features

1. Multi-Market & Sector Breadth Coverage

The dashboard automatically maps a curated list of index benchmarks, equal-weight indices, growth/tech proxies, and sector ETFs based on your selected country:

United States (US): SPY (S&P 500), QQQ (Nasdaq 100), RSP (S&P 500 Equal Weight), IWM (Russell 2000), MDY (S&P MidCap 400), SMH (Semiconductors), IGV (Tech-Software).

India (IN): Nifty 50, Nifty 50 Equal Weight, Nifty 500, Nifty Midcap 100, Nifty Smallcap 100, Nifty IT, Nifty Finance, Nifty Auto, Nifty Banking, Manufacturing, Nifty India Digital.

Japan (JP): Nikkei 225, TOPIX, TOPIX 100, TOPIX Mid 400, Nikkei Mid Small ETF, TOPIX Small Index, Nikkei Semiconductor, Semiconductor ETF, Electric Appliances, TOPIX Machinery.

China (CN): Total Stock Market, Top 300 Index (Weighted & Equal Weight), 50 Large Cap, 500 Mid Cap, 1000 Small Cap, ChiNext 100, Tech/Semis/AI/Biotech.

Taiwan (TW): TAIEX, Top 50 ETF, Mid-Cap 100 ETF, TPEX Weighted Index, Semiconductors Sub-Index, Electronics Sub-Index, Electronic Parts/Components, Market Leader Equal Weight ETF, IT Growth Equal Weight ETF.

South Korea (KR): KOSPI, KOSPI 200, KOSPI Large, KOSPI Mid, KOSPI Small, KOSDAQ, KOSDAQ 150, KOSPI 200 Equal Weight, KQ150 Equal Weight.

https://www.tradingview.com/x/fwCwZqBS/

2. Timeframe-Adaptive Moving Averages

Moving average lengths are automatically adjusted based on your selected Analysis Timeframe to ensure the technical signals match the trend structure of that horizon:

Daily Timeframe: 20 SMA (Short-term), 50 SMA (Medium-term), 200 SMA (Long-term / Macro).
Weekly Timeframe: 10 SMA, 30 SMA, 40 SMA.
Monthly Timeframe: 3 SMA, 6 SMA, 10 SMA.

3. Advanced Hybrid Trend Engine

Rather than relying on a single moving average, the dashboard calculates a Hybrid Trend for each index by combining two distinct methodologies:

SMA Ribbon Trend: Evaluates alignment. A full bullish alignment requires:
Price > SMA 1 > SMA 2 > SMA 3, while a bearish alignment requires:
Price < SMA 1 < SMA 2 < SMA3

Donchian Channel Trend: Checks price relative to the 20-period Donchian mid-line. If the price is within 15% of the Donchian mid-line, the trend is treated as Sideways (congestion). If it breaks out above or below this corridor, it triggers a trend state.

The Hybrid Nuance: A ticker is only marked in an Uptrend if the Donchian trend is bullish and the SMA Ribbon is not bearish. It is marked in a Downtrend if the Donchian trend is bearish and the SMA Ribbon is not bullish. Otherwise, it is classified as Sideways.

https://www.tradingview.com/x/eBLbhjez/

4. Granular Status Classification

Every monitored index is evaluated and categorized into one of five states:

🟢 Very Bullish: Macro bullish (SMA 2 > SMA 3), short-term bullish (SMA1 > SMA2), price trading above the short-term SMA 1, and the Hybrid Trend is actively upward.

🟢 Bullish: Macro and short-term bullish alignments are in place, price is above
SMA 1, but the Hybrid Trend has turned sideways.

🔵 Pullback: Macro and short-term bullish alignments are intact, but price has pulled back below the short-term SMA 1 (while holding above the medium-term SMA 2). Ideal for dip-buying setups.

🟡 Caution: Signals are mixed. This occurs during transitional phases, such as when price is below SMA 2 in a macro uptrend, or when price trades above SMA 1 but the macro alignment is bearish (SMA 2 ≤ SMA 3).

🔴 Bearish: Macro bearish alignment (SMA 2 ≤ SMA 3) and the price is below its short-term
SMA 1.

The Breadth & Stance Engine (Dashboard Footer)

The bottom row of the dashboard acts as the command center, compiling all individual metrics into market breadth stats and a singular directional bias:

https://www.tradingview.com/x/QRX99PD1/

1. Market Stance & Total Open Risk (TOR)

The dashboard calculates a global market posture based on the state of the primary index (e.g., SPY for US, Nifty 50 for India) and the percentage of overall constructive indices:
  • Risk-On (Aggressive) | TOR Open (6-8R): The primary index is Bullish/Very Bullish, ≥ 70% of the market is constructive, and ≤ 10% is Bearish. This is the green light for aggressive long positioning.
  • Risk-On (Selective) | TOR Normal (4-5R): The primary index is constructive, and ≥ 50% of the market is constructive. Longs are favored, but selectivity and tight setups are required.
  • Risk-Off (Defensive) | TOR Tight (1-2R): The primary index is bearish or ≥ 50% of the indices are in a Bearish status. Capital should be defensively positioned; focus shifts to short exposure or hedging.
  • Capital Preservation | TOR Cash (0R): The primary index is Bearish, and ≥ 75% of all indices are in a Bearish status. The system advises sitting in cash.
  • Caution / Neutral | TOR Max 3R: Outlines range-bound or highly rotational conditions. Open risk should be strictly capped.

2. Breadth Ratio Columns

The dashboard displays raw breadth ratios for three structural checkpoints:
  • Price > MA1 (Short-term momentum breadth)
  • MA1 > MA2 (Medium-term structural health)
  • MA2 > MA3 (Long-term structural alignment)

Format: L / S (Long / Short). E.g., 5L / 2S means 5 indices are bullish on that metric, and 2 are bearish.

Color Coding: Automatically highlights in Green if ≥ 70% of the indices are positive, Red if ≥ 60% are negative, and Yellow for rotational/neutral conditions.

Under the Hood: Pine Script v6 Optimization

This script has been engineered to prevent chart lag. All calculations are requested dynamically using a single, optimized request.security tuple call per ticker.
  • No Repainting: The dashboard is calculated strictly on closed historical bars and the live real-time bar using barstate.islast, ensuring that historical data is not distorted and the dashboard is lightweight.
  • Declarative Layouts: The UI adapts row heights dynamically based on the number of active indices for the selected country, preventing empty table cells from wasting screen real estate.
  • User Input Settings
  • Active Market / Country: Switch between US, Korea, China, Taiwan, Japan, and India.
  • Analysis Timeframe: Select Daily, Weekly, or Monthly.
  • Table Position: Choose from 9 positions on your chart canvas.
  • Text Size: Small, Normal, or Large text configurations.
  • Styling & Colors: Fully customize table frames, title background, warning cells, risk stances, and text colors to match your dark or light chart theme.

https://www.tradingview.com/x/18OvRFzr/

⚠️ Important Caution & Risk Disclaimer
Please read and understand the following before incorporating this dashboard into your trading:

Index Decoupling: Sector weightings in modern index products are often heavily skewed toward mega-cap stocks. An index may print "Very Bullish" while the vast majority of individual mid-and-small-cap stocks are struggling. Always cross-reference index breadth with individual stock scans.

Breadth is a Filter, Not a Trigger: The dashboard's output (such as "Risk-On" or "Risk-Off") represents a statistical regime filter of market conditions. It is not a direct buy or sell signal. Trade execution must still rely on your own verified setups, trigger criteria, and risk-reward calculations.

Data & Calculation Lag: Because the dashboard aggregates multiple indices and ETFs, there may be temporary divergences in fast-moving markets or discrepancies between local index data feeds.

No Guarantee of Accuracy: Historical performance of these filters is not indicative of future results. Market regimes can shift rapidly without warning. You must use your own judgment, manage your trade sizing, and implement hard stops on every position. Never risk more capital than you can afford to lose.
Release Notes
1. Timeframe can be auto-detected based on the time period on the chart. Defaults to daily for intra-day timeframe.
2. Ability to build a custom list of tickers (max 20) instead of viewing single country at a time.
Release Notes
1. Reworked on all key Indices and Most relevant sectors for each market
2. Minor UI enhancements:
  • Header and Footer rows are bold
  • If the opened ticker matches any of the indices/sectors being displayed then the row is highlighted (bold)
  • Default widget positioning and text size
Release Notes
Release Notes: Unified Trend Stance & 7-Column Layout

This update optimizes the dashboard layout for space efficiency and introduces a fully symmetrical trend and status evaluation engine.

1. Optimized 7-Column Layout

Combined the separate "Trend" and "Trend Quality" columns into a single unified "Trend" column.
Reduced the dashboard width from 8 to 7 columns to save horizontal screen space: [Ticker | Name | Price > 20 SMA | 20 > 50 SMA | 50 > 200 SMA | Trend | Status].
2. Unified Trend Column

Created combined trend labels that represent both the macro direction and underlying efficiency (using Kaufman's Efficiency Ratio - ER):
Clean Uptrend (Vibrant Green): High efficiency uptrend.
Uptrend (Light Green): Moderate efficiency uptrend.
Clean Downtrend (Vibrant Red): High efficiency downtrend.
Downtrend (Light Red): Moderate efficiency downtrend.
Choppy (Yellow): High noise, low efficiency sideways whip-saws.
Sideways (Grey): Quiet horizontal consolidation.
3. Symmetrical Status Engine & "Very Bearish" Stance

Added a new "Very Bearish" status (Vibrant Red background) to mirror the existing "Very Bullish" (Vibrant Green) status, triggered during high-efficiency aligned downtrends.
Aligned bear market evaluations so that clean downtrends display as "Very Bearish" or "Bearish" rather than "Caution".
Integrated "Very Bearish" counts into the index breadth percentages and the "Market Stance" footer logic.
4. Robust Row Highlighting

Refactored the ticker matching logic using string splitting. The dashboard now cleanly splits and matches ticker symbols with their exchange prefixes (like TSE: or NSE:), ensuring that the row corresponding to your active chart is highlighted under all conditions.
5. Code Optimizations

Cleaned up variable declaration order in the status evaluator to prevent compiler warnings.
Release Notes
Color consistency for Sideways, Choppy and Caution cells in relevant portions of the widget.
Release Notes
Reworked on code comments to be more clear when needed.
Release Notes
Performance optimiztions across the codebase.
Release Notes
Market Strength and Breadth Dashboard - Update Summary

This update modernizes the indicator structure, optimizes performance under Pine Script v6 standards, and introduces timeline date-stamps to provide full timezone transparency.

1. Timeline Date-Stamps for Multi-Market Transparency
We have added a dynamic date suffix (MM-dd) next to the symbol name in the dashboard table.
* Since different global markets operate in different timezones (e.g., Taipei is 12 hours ahead of New York), their daily sessions close at different times.
* The date suffix shows you exactly which calendar day's bar is currently being analyzed for each ticker (e.g., INDEX:TAIEX (06-25) vs. INDEX:TAIEX (06-24)). This clarifies why values shift when switching between US and Asian charts.

2. Calculation Stability via ticker.modify
All request.security calls are now wrapped in ticker.modify(..., session.regular, adjustment.splits).
* This prevents TradingView's local compiler from optimizing data reads directly from your active chart display arrays.
* Your indicators are now protected from changing their calculations if you toggle display settings in your chart UI (such as Extended Session/Pre-market or custom chart timezones).

3. Compile-Time Security Optimization (Pine Script v6)
* Replaced the dynamic array-based security resolution with 20 static compiler-safe slots.
* This ensures the script is fully compliant with modern v6 compilation constraints, eliminating repainting issues and loading lag.

4. Static Fallback Symbols
* Swapped the fallback placeholder from syminfo.tickerid to static, country-specific default symbols. This stabilizes the network fetch pool and improves chart load times when switching tickers.
Release Notes
[h2]Dashboard Real Estate & Layout Optimizations[/h2]

Here is a summary of the layout improvements in the latest update to save screen real estate:

  • Shorter Cell Statuses: Renamed status values from [code]"Above"[/code] / [code]"Below"[/code] to "▲ (Up)" and "▼ (Down)" to save horizontal width inside the data cells.
  • Streamlined MA Column Headers: Cleaned up column headers by eliminating duplicate "SMA" text (e.g. [code]20 SMA > 50 SMA[/code] is now [code]20 > 50 SMA[/code]). This dynamically scales for Weekly/Monthly timeframes as well.
  • Timeframe Clarity: Timeframe suffixes (e.g. [code](DTF)[/code], [code](WTF)[/code], [code](MTF)[/code]) are now shown on the "Name" column header (e.g., [code]Name (DTF)[/code]) and removed from the first column header to prevent text crowding.
  • Shorter Stance Bias: Renamed the default stance bias from [code]"Selective / Neutral"[/code] to "Selective" in the footer to fit cleaner.
Release Notes
Refactored Status State Machine Under the 200 SMA
  • Symmetrically aligned the status evaluation state machine logic under the 200 SMA (Death Cross) with the Golden Cross logic.
  • Amended the status calculation so that healthy recovery trends (price and 20 SMA above the 50 SMA) are classified as Caution (Yellow) rather than defaulting to Bearish.
  • Ensures that pullbacks of recoveries (price holding above the 50 SMA but below the 20 SMA) are also labeled as Caution.
  • Retains the conservative restriction that no recovery under the 200 SMA can achieve "Bullish" or "Very Bullish" statuses.
  • Preserved precise Bearish and Very Bearish designations for assets in active downtrends (price below the 50 SMA or in a high-efficiency breakdown).
  • Corrects aggregate Market Stance calculations and ratio counts in the footer row (e.g., Price > 20 SMA, 20 SMA > 50 SMA counts) by preventing recovery moves from adding false bearish signals.
Release Notes
Title: Global Market Breadth and Stance Dashboard - Multi-Country Expansion

Overview of Changes
Today, the script was updated to expand sector coverage across all major global markets to the maximum 20-ticker slot limit. In addition, the symbol matching and row highlighting system was completely rewritten for better reliability, null-safety, and delayed-feed compatibility.

Market Watchlist Expansions
  • US Market: Expanded to 19 tickers and reordered into a logical GICS-aligned hierarchy (added Real Estate, Staples, Materials, Energy, and Utilities).
  • China Market (000300): Expanded to 20 tickers using the CSI 300 Sector Indices.
  • Korea Market (KOSPI): Expanded to 20 tickers incorporating primary KRX Sector Indices.
  • Japan Market (TOPIX): Expanded to 20 tickers incorporating comprehensive TOPIX Sector Indices.
  • Taiwan Market (TAIEX): Expanded to 20 tickers mapping major electronics, semiconductor, and industrial components.
  • India Market (NIFTY): Expanded to 20 tickers incorporating FMCG, Metals, Energy, Infrastructure, PSU Banks, Media, and Pharma.


Active Row Highlighting & Symbol Match Upgrades
  • Ticker Alias Normalization: Implemented a new match helper f_tickers_are_equal to resolve differences where TradingView internally represents an index with a different ticker name than its search code (e.g. matching 0000688 with its STAR50 ticker alias, and TAIEX with its IX0001 ticker).
  • Null (na) Safety Checks: Added explicit safety checks for syminfo.tickerid, syminfo.ticker, and syminfo.prefix to prevent null-value propagation from breaking comparisons on custom feeds.
  • Delayed Feed Support: Programmed the symbol matcher to strip the delayed feed suffix (e.g. _DLY) from exchange prefixes, allowing symbols like 000300 to highlight properly when loaded on the chart.
Release Notes
Added XBI to track Biotech sector for US market.
Release Notes
Title: Performance and Drawdown Multi-Timeframe Expansion for Market Strength Dashboard

Summary of Updates

  • New Performance Metrics Columns: Integrated four performance and drawdown metrics into the market dashboard table to track short-term momentum, medium-term trend, peak distance, and year-to-date returns across all monitored tickers (such as SPY and QQQ).
  • Multi-Timeframe Adaptive Logic: Added dynamic timeframe support that automatically adjusts metric lookbacks and table headers based on the active timeframe setting (Daily, Weekly, or Monthly):
    • Single-Period Change: Displays % 1D on Daily, % 1W on Weekly, and % 1M on Monthly timeframes.
    • Multi-Period Change: Displays % 5D (5 daily bars), % 4W (4 weekly bars), and % 3M (3 monthly bars).
    • 52-Week High Drawdown (% Off 52WH): Dynamically scales lookbacks across 252 daily bars, 52 weekly bars, or 12 monthly bars.
    • Year-to-Date (% YTD): Automatically tracks returns from the previous calendar year-end close across all timeframes.
  • 4-Tier Graduated Color System for 52-Week High Drawdown:
    • At / Near 52W High (>= -0.5%): Highlighted in bright bullish green for tickers breaking out or trading at new peaks.
    • Consolidation Range (-0.5% to -5.0%): Highlighted in soft bullish green for tight trading near highs.
    • Pullback / Correction (-5.0% to -20.0%): Highlighted in warning yellow for moderate pullbacks.
    • Deep Drawdown (< -20.0%): Highlighted in bearish red for deep drawdowns.
  • Dashboard Layout Expansion: Expanded table layout to 11 columns for structured readability while maintaining market stance breadth summaries.
Release Notes
Title: Dynamic Multi-View and Performance Metrics Update for Market Strength Dashboard

Summary of Today's Enhancements

  • Dynamic Dashboard View Selector: Added a new Active Dashboard View setting allowing users to switch between three display modes:
    • Market Breadth & Stance View (7 Columns): Focuses on moving average participation (SPY, QQQ) and macro market regime summaries.
    • Performance Metrics View (6 Columns): Displays single-period, multi-period, drawdown, and YTD performance returns in a clean table without footer rows.
    • Combined View (11 Columns): Displays all performance and technical breadth metrics together in one comprehensive table.
  • Selective Calculation Engine: Optimized indicator execution speed by conditionally skipping non-active calculations—bypassing moving average alignments when viewing performance metrics, and bypassing 52-week lookbacks when viewing market breadth.
  • Multi-Timeframe Adaptive Performance Metrics:
    • Single-Period Return: Displays % 1D (Daily), % 1W (Weekly), or % 1M (Monthly).
    • Multi-Period Return: Displays % 5D (Daily), % 4W (Weekly), or % 3M (Monthly).
    • 52-Week High Drawdown (% Off 52WH): Scales lookbacks dynamically across 252 daily bars, 52 weekly bars, or 12 monthly bars.
    • Year-to-Date (% YTD): Tracks cumulative return from prior calendar year-end close.
  • 4-Tier Graduated Color System for Drawdown:
    • At / New 52W High (>= -0.5%): Bright bullish green.
    • Near High (-0.5% to -5.0%): Soft bullish green.
    • Pullback (-5.0% to -20.0%): Warning yellow.
    • Deep Drawdown (< -20.0%): Bearish red.
Release Notes
Title: Global Market Strength and Breadth Dashboard - Hong Kong Preset and US Biotech Addition

Overview of Changes
Today, the indicator was upgraded with the addition of a new dedicated preset for the Hong Kong market and an enhanced US sector lineup.

New Hong Kong Market Preset (HSI)
  • Full 20-Ticker Coverage: Added a complete 20-ticker layout for the Hong Kong stock market structured across a 4-tier GICS-aligned framework.
  • Headline & Market Cap Tiers: Includes the Hang Seng Index (HSI), Hang Seng China Enterprises Index (HSCEI), Hang Seng Composite Index (HHSCI), LargeCap (HHSLI), MidCap (HHSMI), SmallCap (HHSSI), and Tracker Fund of Hong Kong (2800).
  • Tech & Innovation: Incorporates the Hang Seng TECH Index (HHSTECH) and Information Technology Sector Index (HHSCI.IT).
  • Comprehensive Sector Indices: Tracks Financials (HHSCI.F), Properties & Construction (HHSCI.P), Industrials (HHSCI.I), Materials (HHSCI.M), Energy (HSCI.E), Conglomerates (HHSCI.C), Healthcare (HSCI.H), Consumer Discretionary (HHSCI.CD), Consumer Staples (HHSCI.CS), Telecommunications (HHSCI.T), and Utilities (HHSCI.U).
  • Symbol Matcher Update: Extended exchange prefix normalization to support both HSI and HKEX prefixes for seamless active-row chart highlighting.


US Watchlist Enhancement (SPY)
  • Biotechnology Integration (XBI): Added the SPDR S&P Biotech ETF (XBI) as the 20th ticker in the US watchlist, positioned directly adjacent to Health Care (XLV) for dedicated risk-on speculative growth tracking.
Release Notes
Title: Dynamic Sector Performance Ranking and Sorting

Overview
This update introduces dynamic performance sorting for sectoral indices across all supported markets when performance views are active. Traders can now view an immediate leaderboard of leading and lagging sectors while keeping key benchmark indices anchored at the top of the dashboard.

Key Features Added
  • Dynamic Sector Sorting: Sectoral rows are dynamically sorted when viewing "Performance Metrics" or "Combined View" to help identify sector rotation and relative strength at a glance.
  • Metric Selection: Added the option to rank sectors by either Multi-Period Performance (% 5D on Daily, % 4W on Weekly, % 3M on Monthly) or Short-Term Performance (% 1D on Daily, % 1W on Weekly, % 1M on Monthly).
  • Key Index Anchoring: Key broad-market benchmark indices (e.g., SPY, $AMEX:QQQ, IWM for the US; Nifty 50 for India; KOSPI for Korea; etc.) remain fixed at the top of the table in their original positions.
  • Leaderboard Rank Badges: Sorted sectoral rows are automatically tagged with their relative rank (#1, #2, ... #N) in the Name column for quick visual identification.
  • Visual Section Divider: Added a dedicated divider row displaying "--" and "Sector Ranking by $COLUMN_NAME" to cleanly separate key market indices from the ranked sectoral indices.
  • Flexible Sort Direction: Added user input options to sort in Descending (default: top gainers to laggards) or Ascending order.


New Input Settings
  • Sort Sectoral Rows by Performance: Toggle to turn dynamic sectoral sorting on or off (Default: On).
  • Sort By Performance Metric: Choose between "Multi-Period Performance" and "Short-Term Performance".
  • Sector Sort Order: Choose between "Descending" and "Ascending".
Release Notes
Title: Market Strength and Breadth Dashboard - Multi-Timeframe Sector Rotation and Lifecycle Stage Tracking

Overview of Today's Updates
Today's release introduces a major new analytical module: the Sector Rotation dashboard view with multi-timeframe ranking and an automated 7-stage lifecycle state machine, alongside streamlined settings organization, independent index/sector sorting, and improved return metric column ordering.

1. Multi-Timeframe Sector Rotation Dashboard
  • Dedicated View Mode: Added "Sector Rotation" to the Dashboard View selector, tracking capital rotation across four key horizons: Quarterly (3M / 63D), Monthly (1M / 21D), Weekly (1W / 5D), and Daily (1D).
  • Three Ranking Methodologies:
    • Composite Strength: Structural multi-factor scoring model blending moving average alignment (20, 50, 200 SMA), Donchian Channel breakout states, Kaufman Efficiency Ratio (ER), and return momentum.
    • Returns: Ranks assets strictly by trailing percentage performance across time horizons.
    • Both (Compare): Displays side-by-side comparative rank columns for structural strength vs. pure returns.
  • Zero-Padded Rank Trajectories: Ranks are formatted as clean, fixed-width strings (e.g., #01 -> #02 -> #03 -> #01) with an optional raw score debug toggle.


2. Rotation Stage Lifecycle State Machine
  • Seven Lifecycle Stages: Classifies each asset into intuitive stages: Core Leader, Emerging, Improving, Stable, Softening, Fading, and Laggard.
  • Trend Filter Gate (Price > 20 SMA): Requires constructive price action above the 20 SMA for all bullish badges, preventing counter-trend bounces in downtrending charts from generating false leadership signals.
  • Weekly Confirmation: Measures rank advances across durable Monthly-to-Weekly horizons rather than single-day noise.
  • Precedence & Decay Refinements: Prioritizes chronic bottom-tier laggards before fading evaluations, and ensures warning stages strictly display negative net deterioration from prior peaks.
  • Left-Aligned Column Values: Left-aligned Rotation Stage values for improved badge and label readability.


3. Dual-Group Independent Sorting
  • Partitioned Sorting: Benchmark indices (e.g. SPY, QQQ, IWM) remain pinned at the top and sort amongst themselves, while sector ETFs sort exclusively amongst their sectoral peers below the divider.
  • Direct Metric Sorting: Added direct sorting options for Composite Strength Rank, Rotation Stage, Return Rank, Weekly Rank, Monthly Rank, Quarterly Rank, % YTD, and % Off 52WH.


4. Streamlined Metric Grouping & Settings Layout
  • Return Metric Grouping: Reordered % Off 52WH immediately after % YTD so that all return-based performance metrics are grouped sequentially.
  • Restructured Settings Dialog: Consolidated inputs into 5 clean, single-column groups: General & Dashboard Layout, Sector Rotation Settings, Performance & Combined View Settings, Table Styling & Colors, and Custom Market Tickers.
Release Notes
Title: Global Market Breadth, Sector Rotation and Real-Time Alert Engine

Overview
Today's release introduces a major architectural and functional upgrade to the Market Strength and Breadth Dashboard. This update refactors the core data pipeline into Pine Script v6 User-Defined Types (UDT), integrates Relative Volume (RVOL) confirmation into composite trend scoring, adds customizable moving averages with automatic timeframe scaling, optimizes performance via native array sorting, introduces a compact layout mode for small screens, and deploys a real-time alerting engine with batched sector rotation bulletins.

Summary of Changes

  • Pine Script v6 UDT Refactoring: Replaced complex tuple-based data handling with strongly typed SymbolRaw and SymbolItem User-Defined Types. This streamlines data fetching, memory footprint, and symbol ingestion into a single standardized pipeline.
  • Volume Confirmation (RVOL) in Composite Strength: Integrated a 20-period Relative Volume (RVOL) filter into the Daily Composite Strength scoring model. Breakouts backed by elevated volume (RVOL >= 1.3) receive a +5 point boost, while low-volume advances (RVOL < 0.7) receive a -5 point deduction. Spot and cash indices lacking volume feeds gracefully default to neutral weighting without distorting scores.
  • Real-Time Alerting Engine: Added native TradingView alert integration with bar-close confirmation (barstate.isconfirmed), eliminating intra-day whipsaws and false triggers. The alert conditions include:
    • Market Stance Shift: Triggers when market posture transitions between regimes (e.g., Risk-On, Caution, Risk-Off, Capital Preservation).
    • Sector Leadership Transition: Triggers when any sectoral tracker enters a key institutional phase (Core Leader, Emerging, or Fading).
    • Any alert() function call: Supports unified, dynamic notifications containing full ticker, breadth, and transition details.
  • Batched Sector Rotation Bulletins: When multiple sectors rotate on the same bar close, all transitions are consolidated into a single structured bulletin with clean bulleted items, ensuring no rotating sector is missed due to TradingView's single-alert-per-bar limitation.
  • Startup Spam & Universe Switch Suppression: Implemented state persistence that establishes baseline conditions on chart load and universe switches, preventing false alerts when adding the indicator or switching between country presets.
  • Customizable Moving Averages & Timeframe Scaling: Added an MA formula selector (SMA vs. EMA) and custom Fast, Medium, and Slow period inputs. MA lengths unconditionally scale across timeframes (configured values on Daily, 10/30/40 on Weekly, and 3/6/10 on Monthly), with table headers adapting dynamically.
  • Compact View Mode: Introduced a Compact Mode toggle that condenses the dashboard layout down to 4–8 essential columns, optimized for laptops, split-chart views, and small displays.
  • Native Sorting Optimization: Replaced legacy multi-pass sorting loops with compiled Pine Script v6 array.sort_indices(), significantly accelerating ranking execution with stable tie-breaking and deterministic NaN handling.
  • Custom Universe Benchmark Partitioning: Added configurable benchmark slot allocation (custom_key_count) for Custom universes, ensuring visual dividers and independent rankings partition benchmark indices from sector components across all views.
Release Notes
Title: Market Strength and Breadth Dashboard - Rotation Stage Stability and RRG-Style Smoothing

Overview

This update addresses a known sensitivity issue in the Sector Rotation view where a single bearish
session could cause meaningful degradation of a sector's Rotation Stage label. The root cause was
traced to three unsmoothed daily inputs that fed directly into the composite scoring and stage
evaluation logic. Four targeted, additive changes were made to introduce configurable momentum
inertia — similar in spirit to how Relative Rotation Graphs (RRG) smooth RS-Ratio and RS-Momentum to prevent single-session noise from driving
quadrant migrations.

What Was Changed

1. Daily Return Smoothing in Composite Score

The raw 1-day return was previously applied directly to the Daily Composite Score with a
multiplier of 3.0 points per percent. A single -2% session could therefore subtract
-6 raw points from the composite score instantly, reshuffling daily ranks by 2-3 positions.

A 3-bar EMA of the daily return (internally called pct_1d_ema3) is now used as
the input to the daily composite scoring function instead of the raw value. This halves the
immediate impact of a single session while still delivering the full signal after 3 consecutive
sessions in the same direction. The raw % 1D display column remains unchanged.

2. Configurable 20 SMA Gate Tolerance Band

The price > 20 SMA condition was previously a hard binary gate evaluated on every bar.
A sector closing even marginally below its 20 SMA would instantly lose eligibility for all
bullish Rotation Stage badges (Core Leader, Emerging, Improving),
causing abrupt stage demotions from a single session's close.

A configurable tolerance band has been introduced. By default, price is allowed to be
up to 0.5% below the 20 SMA before the gate triggers. This filters hairline SMA breaks
and intraday noise without masking genuine structural breakdowns, which typically involve closes
1% or more below the average. Setting the tolerance to 0.0% restores the original binary behavior.

3. Smoothed Daily Composite Score for Rank Computation

The daily composite score was recalculated from scratch on every bar and used immediately to
compute rank_comp_d. Because this score still reflected the session's raw return, ranks
could shift by 1-2 positions in a single session, which in turn altered the shift_w
differential used to assign Rotation Stage labels.

A configurable EMA smoothing pass (default: 3 bars) is now applied to the daily
composite score before ranks are computed. This is the closest structural analog to RRG's
double-smoothing: the score first absorbs the smoothed daily return (Change 1), and then the
score itself is smoothed again before ranking. Raw composite scores are preserved for display
and debug mode. Setting the length to 1 disables smoothing entirely.

4. Configurable Weekly Return Smoothing

The 5-day rolling return used in the Weekly Composite Score (p5d * 1.5) could still
shift the weekly composite meaningfully on a large single-session move, propagating into weekly
rank changes and the shift_w calculation.

A configurable EMA smoothing length (default: 2 bars) is now applied to the 5-day
return before it enters the weekly composite scoring function. The raw % 5D display column
is unaffected. Setting the length to 1 disables smoothing.

New Settings (Sector Rotation Settings Group)

  1. 20 SMA Gate Tolerance (%) — Default: 0.5%. Range: 0.0 to 2.0 in steps of 0.25. Set to 0.0 to restore the original hard binary gate. Increase to 1.0-1.5% for more volatile instruments.
  2. Rank Smoothing Length — Default: 3 bars. Range: 1 to 10. Controls EMA smoothing of daily composite scores before rank computation. Set to 1 to disable.
  3. Weekly Return Smoothing — Default: 2 bars. Range: 1 to 5. Controls EMA smoothing of the 5-day return before it enters the weekly composite score. Set to 1 to disable.


What Was Not Changed

  • % 1D and % 5D display columns — still show raw, unsmoothed returns
  • Weekly, Monthly, and Quarterly composite scores — unchanged
  • Market Breadth and Stance view — unchanged
  • Performance Metrics view — unchanged
  • Debug mode raw composite score values — still surfaced as before
  • Return-based ranking path (calc_ret) — unchanged


Backward Compatibility

Setting all three new inputs to their minimum values (Tolerance = 0.0%,
Rank Smoothing = 1, Weekly Smoothing = 1) produces output identical to the
previous version of the script.
Release Notes
Title: Sector Rotation Stage Engine - Coiling Stage, SMA-Aware Fading, and Q-M-W Signal Philosophy

Overview

This update refines the sector rotation stage classification logic with three targeted improvements. The changes address a systematic mislabeling issue where sectors building a constructive base above their 20-period SMA were being incorrectly flagged as "Fading" due to a temporary softness in their weekly rank. A new stage is introduced, the Fading trigger is made structure-aware, and the daily rank signal is removed from stage downgrade conditions.

Fix 1 — SMA-Aware Fading Threshold

The Fading condition previously fired whenever a former top-ranked sector experienced a weekly rank drop of emerg_shift or more, regardless of whether price was above or below the 20 SMA. This caused sectors in healthy consolidations — still above their 20 SMA — to be labeled Fading.

The condition is now split by structure. Sectors holding above the 20 SMA now require one additional rank of deterioration before the Fading label is applied.

Fix 2 — New "Coiling" Rotation Stage

A new stage is inserted between Laggard and Fading in the evaluation order. It fires when a former top-ranked sector (by monthly or quarterly composite rank) holds above the 20 SMA while experiencing moderate weekly rank softness within the emerg_shift band.

The stage hierarchy is now:
  1. Core Leader — score 700
  2. Emerging — score 600
  3. Improving — score 500
  4. Coiling — score 450 (new)
  5. Stable — score 400
  6. Softening — score 300
  7. Fading — score 200
  8. Laggard — score 100


Fix 3 — Q-M-W Signal Philosophy (Daily Rank Removed from Stage Triggers)

The daily rank delta (shift_d) was previously a secondary trigger in both the Fading and Softening conditions. A single down day in daily composite rank could push a sector from Stable or Softening into a Fading label.

The daily rank (rd) is now retained only as a tiebreaker in the Core Leader stage score and as a confirmation gate in the Emerging condition. It is not used to trigger any stage downgrade.

Impact Example

A semiconductor sector ETF with the following rank progression — Quarterly #7, Monthly #2, Weekly #6, Daily #3 — and price trading above its 20 SMA, was previously labeled "Fading (-4)". With this update, it is now correctly classified as "Coiling", reflecting a healthy base-building phase within a still-constructive trend structure.
Release Notes
Title: Market Strength and Breadth Dashboard - Institutional Sector Rotation and Multi-Factor Ranking Engine Upgrade

Overview of Today's Release
This update delivers an institutional-grade overhaul to the Sector Rotation ranking model and composite scoring engine. The scoring model now blends long-term regime health, intermediate trend confirmation, volatility-normalized momentum, directional volume accumulation, and market alpha relative to the primary benchmark.

Key Improvements and Functional Changes
  • Master Weighted Composite Scoring: Replaced the previous single-day sort key with a balanced 4-timeframe composite score:
    • Quarterly Horizon (30% weight): Institutional regime baseline ($Price > 200$ SMA, 50/200 SMA alignment, 63-day alpha, and continuous 52-week high proximity).
    • Monthly Horizon (35% weight): Macro structural trend health (200 SMA baseline, Golden Cross status, 21-day alpha, and continuous 52-week high proximity).
    • Weekly Horizon (25% weight): Intermediate swing confirmation ($Price > 50$ SMA, 20/50 SMA alignment, 5-day alpha, and 5-day volume flow).
    • Daily Horizon (10% weight): Tactical timing ($Price > 20$ SMA, 20/50 SMA alignment, 1-day alpha, and directional RVOL).

    This weighting ensures long-term leadership and macro strength (65% combined weight) dictate sector ranking, preventing single-day volatility from distorting structural sector leadership.
  • Directional and Multi-Day Volume Engine:
    • Direction-Aware Daily RVOL: High volume on advancing days confirms institutional accumulation (+5 pts), whereas high volume on declining days penalizes institutional distribution (-5 pts). Orderly, low-volume pullbacks receive constructive credit (+2 pts), while low-volume advances are penalized (-2.5 pts).
    • 5-Day Volume Flow Ratio: Integrated a 5-day up/down volume flow metric into the weekly composite score to track multi-day institutional capital flow.
    • Graceful Cash Index Fallback: Tickers and market universes without volume data (such as cash indices) automatically default to zero volume points without score distortion.
  • Volatility Normalization (ATR%):
    Return momentum across all horizons (1D, 5D, 21D, 63D) is now normalized by 14-period ATR% (Return / ATR%). This levels the playing field between high-beta sub-sectors (such as $AMEX:SMH or IGV) and diversified core sectors (such as XLK or XLF).
  • Relative Strength (Market Alpha vs. Benchmark):
    Directly measures excess performance relative to the primary market benchmark (such as SPY for US markets) across 1D, 5D, 21D, and 63D horizons. Sectors are rewarded for generating true alpha rather than passive beta during broad market lift.
  • Continuous 52-Week High Proximity Curves:
    Replaced discrete step-function thresholds with smooth continuous curves in Monthly (up to 12 pts) and Quarterly (up to 18 pts) scoring. Granular credit is awarded continuously as price approaches and prints fresh all-time highs.
  • Core Leader Tiebreaker Enhancement:
    Upgraded the tiebreaker logic within the Core Leader rotation stage. Leaders are now differentiated by their Master Composite strength and 52-week high proximity bonus rather than single-day rank, ensuring assets holding all-time highs and unanimous macro leadership maintain their top position.
  • Sorting and Dashboard Ergonomics:
    • Composite Strength Rank Sort: The default sector rotation sort order now sorts by the Master Composite Score.
    • Daily Rank Option: Added an explicit "Daily Rank" option to the "Sort Sectors By" dropdown for users who wish to isolate single-day performance.
    • Heatmap Alignment: The heatmap background in the composite rank column now reflects overall Master Composite Rank.
    • Debug Display: The raw rank debug view now displays the Master Composite Score alongside individual horizon scores.
Release Notes
Title: Market Strength and Breadth Dashboard: Added RSPT Equal Weight Tech ETF and 21-Slot Universe Capacity

US Market Universe Enhancements
  • Added RSPT (Invesco S&P 500 Equal Weight Technology ETF) as Slot 7 in the US market preset, positioned directly alongside XLK (Technology), $AMEX:SMH (Semiconductors), and IGV (Tech-Software) to provide comprehensive equal-weight versus market-cap technology breadth evaluation.
  • Realigned subsequent US sector ETFs down through Slot 20 (XLU) to keep the full 15-sector lineup intact.
  • Mapped the display name for RSPT as "Equal Weight Tech" across all dashboard views.


Universe Capacity Expansion (21 Slots)
  • Expanded the underlying universe pipeline from 20 to 21 slots across compiled security fetches, analytical state arrays, and dashboard table row grids.
  • Added Slot 21 ticker input for Custom market universe configurations and increased the maximum benchmark count setting to 20.
  • Scaled table clear boundaries and layout dimensioning to handle up to 21 active instruments plus section dividers and breadth summary footers without truncation.


Active Chart Row Highlighting Fix
  • Upgraded chart ticker matching logic to perform exact token comparison on exchange-stripped ticker IDs rather than substring searching.
  • Resolved a collision where viewing RSPT on the chart caused both RSP and RSPT table rows to highlight simultaneously due to prefix matching.
  • Added automatic cleaning of leading dollar sign prefixes to support cashtags in custom slot inputs and symbol matching seamlessly.
  • Added standard display name mappings for RSPT as well as Select Sector SPDR ETFs (XLB, XLE, XLP, XLRE, XLU) in predefined name lookups.

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.