OPEN-SOURCE SCRIPT

Sector Sweeper

280
Ranks the 11 sectors and 12 key industries by performance — strongest at the top — so you know where to hunt before you pick a stock.

Strong stocks tend to come from strong groups. Sector Sweeper shows which sectors and industries are leading the market right now, ranked top to bottom on one clean board — so you start your search in the right place instead of guessing.

It works on its own — nothing else required.

How it measures — no black box

Each row pulls that ETF's closing prices and computes its percent change over your lookback window; the lists are then sorted strongest to weakest. No smoothing, no proprietary formula — the value is having all 23 groups measured by the same yardstick, on one board, updated every bar, instead of flipping through 23 charts to build the same picture by hand.

What it shows — two tables

•SECTORS — the 11 S&P sector ETFs (Technology, Financials, Energy, Health Care, …), ranked by performance over your lookback.

•SUB-INDUSTRIES — 12 sharper themes (Semiconductors, Software, Biotech, Oil Services, Gold Miners, Airlines, …), ranked the same way.

Each row shows the ETF and its % move over the lookback. Green = up, red = down, and the #1 in each list is highlighted in gold

How to read it

• Top of the list = where money is flowing. Bottom = what's lagging.
• Use it **top-down**: spot the strongest sector or industry here, then go find the leading stocks inside that group.
• Watch it over time — a group climbing the board is rotating into favor; one sliding down is falling out of it.

Settings — defaults work out of the box

• Lookback (bars) — the performance window (20 by default ≈ about a month on a daily chart).
• Each table has its own position (default: Sectors = Middle Left, Sub-Industries = Middle Right) plus table size, dark/light theme, and colors.

⚠ Educational tool for market context and planning. It ranks performance — it does not give buy/sell signals or predict price. Not financial advice.







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.