OPEN-SOURCE SCRIPT
NQUSB Sector Industry Stocks Strength

A Comprehensive Multi-Industry Performance Comparison Tool
The complete Pine Script code and supporting Python automation scripts are available on GitHub:
GitHub Repository: https://github.com/simsisim/tradingview_indicators
Original idea from [tradingview.com/script/5NsvcOVp-Industry-Group-Strength/] by tradingview.com/u/Amphibiantrading/.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
═══ WHAT'S NEW ═══
4-Level Hierarchical Navigation:
- Primary: All 11 NQUSB sectors (NQUSB10, NQUSB15, NQUSB20, etc.)
- Secondary (Default): Broad sectors like Technology, Energy
- Tertiary: Industry groups within sectors
- Quaternary: Individual stocks within industries (37 semiconductors)
Enhanced Stock Coverage:
- 1,176 total stocks across 129 industries
- 37 semiconductor stocks
- Market-cap weighted selection: 60% tech / 35% others
- Range: 1-37 stocks per industry
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
═══ CORE FEATURES ═══
1. Drill-Down/Drill-Up Navigation
View NVDA at different granularity levels:
- Quaternary: ● NVDA ranks #3 of 37 semiconductors
- Tertiary: ✓ Semiconductors at 85% (strongest in tech hardware)
- Secondary: ✓ Tech Hardware at 82% (stronger than software)
- Primary: ✓ Technology at 78% (#1 sector overall)
Insight: One indicator, one stock, four perspectives - instantly see if strength is stock-specific, industry-specific, or sector-wide.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2. Visual Current Stock Identification
Violet Markers - Instant Recognition:
- ● (dot) marker when current stock is in top N performers
- ✕ (cross) marker when current stock is below top N
- Violet color (#9C27B0) on both symbol and value labels
- Example: "NVDA ● ranks #3 of 37"
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3. Rank Display in Title
Dynamic title shows performance context:
- "Semiconductors (RS Rating - 3 Months) | NVDA ranks #3 of 37"
- #1 = Best performer, higher number = lower rank
- Total adjusts if current stock auto-added
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4. Auto-Add Current Stock
Always Included:
- Current stock automatically added if not in predefined list
- Example: Viewing PRSO → "PRSO ranks #37 of 39 ✕"
- Works for any stock - from NVDA to obscure small-caps
- Violet markers ensure visibility even when ranked low
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
═══ DUAL PERFORMANCE METRICS ═══
RS Rating (Relative Strength):
- Normalized strength score 1-99
- Compare stocks across different price ranges
- Default benchmark: SPX
% Return:
- Simple percentage price change
- Direct performance comparison
11 Time Periods:
1 Week, 2 Weeks, 1 Month, 2 Months, 3 Months (Default), 6 Months, 1 Year, YTD, MTD, QTD, Custom (1-500 days)
Result: 22 analytical combinations (2 metrics × 11 periods)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
═══ USE CASES ═══
Sector Rotation Analysis:
- Is NVDA's strength semiconductors-specific or tech-wide?
- Drill through all 4 levels to find answer
- Identify which industry groups are leading/lagging
Finding Hidden Gems:
- JPM ranks #3 of 13 in Major Banks
- But Financials sector weak overall (68%)
- = Relative strength play in weak sector
Cross-Industry Comparison:
- 129 industries covered
- Market-wide scan capability
- Find strongest performers across all sectors
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
═══ TECHNICAL SPECIFICATIONS ═══
V32 Stats:
- Total Industries: 129
- Total Stocks: 1,176
- File Size: 82,032 bytes (80.1 KB)
- Request Limit: 39 max (Semiconductors), 10-16 typical
- Granularity Levels: 4 (Primary → Quaternary)
Smart Stock Allocation:
- Technology industries: 60% coverage
- Other industries: 35% coverage
- Market-cap weighted selection
- Formula: MIN(39, MAX(5, CEILING(total × percentage)))
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
═══ KEY ADVANTAGES ═══
vs. Single Industry Tools:
- ✓ 129 industries vs 1
- ✓ Market-wide perspective
- ✓ Hierarchical navigation
- ✓ Sector rotation detection
vs. Manual Comparison:
- ✓ No ETF research needed
- ✓ Instant visual markers
- ✓ Automatic ranking
- ✓ One-click drill-down
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
For complete documentation, Python automation scripts, and CSV data files:
https://github.com/simsisim/tradingview_indicators
Version: V32
Last Updated: 2025-11-30
Pine Script Version: v5
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
For complete documentation, Python automation scripts, and CSV data files used:
github.com/simsisim/tradingview_indicators
github.com/simsisim/tradingview_indicators
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
For complete documentation, Python automation scripts, and CSV data files used:
github.com/simsisim/tradingview_indicators
github.com/simsisim/tradingview_indicators
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.