INVITE-ONLY SCRIPT

NHNL Breadth Scanner [BIG]

17
═══════════════════════════════════════════════════════════════════════════════
NVENTURES NHNL BREADTH SYSTEM v2.0
═══════════════════════════════════════════════════════════════════════════════


OVERVIEW

The NVentures NHNL Breadth System is an institutional-grade market breadth analysis framework designed for equity traders, portfolio managers, and market technicians who require comprehensive internal market structure visibility beyond price action alone. This system integrates New Highs - New Lows (NHNL) data across multiple exchanges with participation breadth metrics to identify market regime shifts, thrust conditions, divergences, and rotation dynamics between large-cap and small-cap equities.

Version 2.0 introduces the Participation Breadth Module, which monitors the percentage of stocks above their 50-day moving averages across S&P 500, Russell 2000, and NASDAQ 100 indices. This extension enables detection of Risk-On/Risk-Off rotations and narrow rally conditions—critical information for portfolio construction, sector allocation, and tactical hedging decisions.

The framework combines:
- Multi-exchange NHNL aggregation – NYSE, NASDAQ, AMEX breadth data integration
- McClellan Oscillator – Exponential moving average difference for trend momentum
- Thrust detection – Extreme breadth expansion/contraction identification
- Divergence analysis – Price vs. breadth non-confirmation patterns
- Participation breadth – Large-cap vs. small-cap rotation detection
- Composite signal scoring – Multi-factor quantitative breadth assessment


═══════════════════════════════════════════════════════════════════════════════
CORE METHODOLOGY
═══════════════════════════════════════════════════════════════════════════════

• NHNL Data Aggregation

The system retrieves daily New Highs and New Lows from three major U.S. exchanges:

- NYSE – INDEX:HIGN (New Highs), INDEX:LOWN (New Lows)
- NASDAQ – INDEX:HIGQ (New Highs), INDEX:LOWQ (New Lows)
- AMEX – INDEX:HIGA (New Highs), INDEX:LOWA (New Lows)

Users can toggle exchanges on/off to isolate specific market segments. All three exchanges are enabled by default for comprehensive market-wide breadth measurement.

Core Calculations:
- NHNL Raw = Total New Highs - Total New Lows
- NHNL % = (NHNL Raw / Total Issues) × 100
- NH/NL Ratio = New Highs / New Lows

These metrics quantify the internal strength or weakness of market advances/declines independent of price index levels.


• McClellan Oscillator

The McClellan Oscillator applies exponential moving average (EMA) logic to NHNL data:

Formula: McClellan Osc = EMA(NHNL, Fast) - EMA(NHNL, Slow)
Default parameters: Fast = 19, Slow = 39

Interpretation:
- Positive values = Breadth momentum favors bulls (more issues making new highs)
- Negative values = Breadth momentum favors bears (more issues making new lows)
- Zero-line crosses = Regime change signals (bullish above, bearish below)
- Extreme readings (>±100) = Overbought/oversold breadth conditions

The McClellan Oscillator is a standard institutional breadth tool used by market technicians since the 1960s. It smooths daily NHNL volatility while maintaining responsiveness to trend changes.


• Thrust Detection

Thrust conditions identify extreme breadth expansion or contraction that historically precedes sustained directional moves:

Bullish Thrust:
- NHNL % > Threshold (default +40%)
- Sustained for Confirmation Bars (default 2 bars)
- Context: Extreme positive breadth expansion. Historically associated with major rally initiations or continuation thrusts.

Bearish Thrust:
- NHNL % < -Threshold (default -40%)
- Sustained for Confirmation Bars (default 2 bars)
- Context: Extreme negative breadth contraction. Historically associated with panic selling, capitulation events, or major downtrend acceleration.

Thrust conditions are the highest-priority signals in the framework and override other conflicting indicators.


• Divergence Detection

The system identifies non-confirmation patterns between price action and breadth:

Bullish Divergence:
- Price makes lower low
- NHNL % makes higher low
- Context: Selling pressure exhausting despite lower prices. Potential reversal signal as fewer stocks participate in decline.

Bearish Divergence:
- Price makes higher high
- NHNL % makes lower high
- Context: Rally losing internal momentum despite higher prices. Potential reversal signal as fewer stocks participate in advance.

Divergences use pivot detection with configurable lookback periods (default 50 bars) and pivot strength (default 5 bars). Visual divergence lines are drawn directly on the price chart when detected.


• Participation Breadth Module (NEW in v2.0)

This module monitors the percentage of stocks trading above their 50-day moving average across three major indices:

- S&P 500 – INDEX:S5FI (Large-cap participation)
- Russell 2000 – INDEX:R2FI (Small-cap participation)
- NASDAQ 100 – INDEX:NDFI (Tech-cap participation)

Rotation Spread Calculation:

Rotation Spread = Russell 2000 % Above 50D - S&P 500 % Above 50D

Interpretation:
- Positive Spread (>+10%) = Risk-On Rotation
Small caps outperforming large caps. Broad market participation. Risk appetite expanding.

- Negative Spread (<-10%) = Risk-Off Rotation
Large caps outperforming small caps. Narrow rally / defensive positioning. Flight to quality or concentration risk.

- Neutral (-10% to +10%) = Balanced market, no clear rotation

This spread identifies critical regime changes between broad market participation (healthy) and narrow leadership (fragile). Risk-On rotations typically occur during economic expansion phases; Risk-Off rotations occur during uncertainty, recession fears, or late-cycle conditions.


• Composite Signal Score

The framework generates a quantitative breadth score (-100 to +100) by weighting five components:

1. Thrust Score (±40 points) – Active thrust condition
2. Trend Score (±30 points) – McClellan Oscillator above/below zero
3. Momentum Score (±20 points) – NHNL % magnitude
4. Ratio Score (±10 points) – NH/NL Ratio extremes
5. Participation Score (±15 points) – Risk-On/Risk-Off regime + participation health

The composite score is smoothed (EMA 5) and classified into five breadth states:
- +50 to +100 = Strong Bull
- +20 to +50 = Bullish
- -20 to +20 = Neutral
- -50 to -20 = Bearish
- -100 to -50 = Strong Bear


═══════════════════════════════════════════════════════════════════════════════
SIGNAL HIERARCHY & PRIORITY
═══════════════════════════════════════════════════════════════════════════════

The indicator generates multiple signal types with distinct priority levels:

Priority 1: Thrust Signals (Highest conviction)
- Green triangle below bar = Bullish Thrust (40%+ breadth expansion)
- Red triangle above bar = Bearish Thrust (40%+ breadth contraction)
- Chart background highlighted in green/red during active thrust

Priority 2: Rotation Signals (Regime identification)
- Cyan diamond below bar = Risk-On Rotation (small caps outperforming)
- Orange diamond above bar = Risk-Off Rotation (large caps outperforming)
- Chart background highlighted in cyan/orange during active rotation

Priority 3: Divergence Signals (Reversal warnings)
- Green label below bar = Bullish Divergence (price/breadth non-confirmation)
- Red label above bar = Bearish Divergence (price/breadth non-confirmation)
- Dashed lines connect divergence pivot points on price chart

Priority 4: Zero-Line Cross (Trend changes)
- Small circle below bar = McClellan crossing above zero (breadth turning positive)
- Small circle above bar = McClellan crossing below zero (breadth turning negative)


═══════════════════════════════════════════════════════════════════════════════
VISUAL COMPONENTS
═══════════════════════════════════════════════════════════════════════════════

• Comprehensive Information Panel

The top-right dashboard (position customizable) displays:

Section 1: Raw NHNL Data
- Total New Highs (green)
- Total New Lows (red)
- Exchange breakdown (NYSE, NASDAQ, AMEX) with individual deltas

Section 2: Core Metrics
- NHNL % with visual indicator (🔥 for thrusts, arrows for direction)
- NH/NL Ratio with strength bars
- McClellan Oscillator with directional arrows

Section 3: Participation Breadth (NEW)
- S&P 500 % above 50D MA with trend arrow
- Russell 2000 % above 50D MA with trend arrow
- NASDAQ 100 % above 50D MA with trend arrow
- Rotation Spread with regime icon (🚀 Risk-On, 🛡️ Risk-Off)

Section 4: Composite Assessment
- Signal Score (-100 to +100) with visual strength bars
- Market Status (large text): BULLISH THRUST, BEARISH THRUST, RISK-ON ROTATION, RISK-OFF ROTATION, or breadth state classification


• Chart Overlays

- Background color-coding for active regimes (thrust, rotation, extreme readings)
- Signal markers (triangles, diamonds, circles, labels) at key inflection points
- Divergence lines connecting pivot highs/lows on price chart


═══════════════════════════════════════════════════════════════════════════════
KEY FEATURES
═══════════════════════════════════════════════════════════════════════════════

- Multi-exchange breadth aggregation – NYSE, NASDAQ, AMEX with individual on/off toggles
- Institutional McClellan Oscillator – Standard market breadth momentum tool
- Automated thrust detection – Identifies extreme breadth conditions with confirmation logic
- Price-breadth divergence scanning – Non-confirmation pattern detection with visual lines
- Participation breadth integration – Risk-On/Risk-Off rotation detection via large-cap vs. small-cap analysis
- Composite signal scoring – Quantitative multi-factor breadth assessment
- No repainting – All signals confirm on bar close
- Comprehensive alerting – 12+ alert conditions for thrust, divergence, rotation, and confluence events
- Fully customizable parameters – EMA periods, thresholds, lookbacks, visual settings
- Professional dashboard – Real-time metrics with color-coded status indicators


═══════════════════════════════════════════════════════════════════════════════
HOW TO USE
═══════════════════════════════════════════════════════════════════════════════

1. Apply to any chart – The indicator pulls multi-security data; chart symbol does not matter (commonly applied to SPY, SPX, or QQQ for reference)

2. Monitor the dashboard:
• Focus on Market Status (bottom row) for current regime
• Check NHNL % and McClellan for breadth direction and momentum
• Watch Rotation Spread for large-cap vs. small-cap dynamics
• Review Signal Score for composite breadth strength

3. Interpret thrust signals (highest priority):
Bullish Thrust → Major rally initiation or continuation likely. Consider adding long exposure or reducing hedges.
Bearish Thrust → Major decline or capitulation event likely. Consider reducing exposure or adding hedges.
• Historical context: Thrust signals are rare (2-5 per year) but highly reliable for significant market moves.

4. Interpret rotation signals (regime identification):
Risk-On Rotation → Broad market participation. Small caps outperforming. Healthy advance. Favor cyclical sectors, higher beta names.
Risk-Off Rotation → Narrow rally or defensive positioning. Large caps outperforming. Caution—market leadership concentrating. Favor quality, defensives.

5. Interpret divergence signals (reversal warnings):
Bullish Divergence → Selling exhaustion. Potential bottom formation. Wait for confirmation (zero-line cross, thrust) before aggressive positioning.
Bearish Divergence → Rally losing momentum. Potential top formation. Consider profit-taking or hedging.

6. Combine signals for maximum conviction:
Bull Confluence: Bullish Thrust + Risk-On Rotation + Positive McClellan = Maximum bullish alignment
Bear Confluence: Bearish Thrust + Risk-Off Rotation + Negative McClellan = Maximum bearish alignment
• Alert system specifically flags these high-conviction confluences

7. Configure parameters for your style:
Thrust Threshold: Default 40% catches major moves. Increase to 50%+ for extreme-only signals.
Rotation Threshold: Default 10% spread. Tighten to 7.5% for earlier rotation detection.
Divergence Lookback: Default 50 bars. Extend to 100+ for longer-term divergences.

8. Use alerts for proactive monitoring:
• Set TradingView alerts for Thrust, Rotation, Divergence, and Confluence conditions
• Receive notifications when critical breadth regime changes occur


═══════════════════════════════════════════════════════════════════════════════
LIMITATIONS
═══════════════════════════════════════════════════════════════════════════════

- U.S. equity markets only – NHNL data limited to NYSE, NASDAQ, AMEX. Does not cover international markets or other asset classes.

- Daily timeframe only – NHNL data is reported daily. Intraday trading requires alternative breadth measures.

- Lagging in fast reversals – McClellan Oscillator and participation metrics use EMAs, introducing lag during rapid regime shifts. Thrust signals respond faster but require extreme conditions.

- Equal-weighting assumption – All stocks within NHNL counts are equally weighted. Large-cap-dominated rallies (e.g., FANG-led advances) may show strong price performance despite mediocre breadth.

- False positives in sideways markets – Divergence signals can produce false positives during extended consolidation phases. Require confirmation from thrust or rotation signals.

- Participation data quality – S5FI, R2FI, NDFI data from TradingView may have occasional gaps or delays. Indicator includes data validation logic and falls back gracefully when data unavailable.


═══════════════════════════════════════════════════════════════════════════════
TECHNICAL SPECIFICATIONS
═══════════════════════════════════════════════════════════════════════════════

- Pine Script v5
- Non-repainting (signals confirmed on bar close)
- Multi-security data feeds (6 NHNL tickers + 3 participation tickers)
- Maximum 500 lines supported (divergence line drawing)
- Real-time dashboard table with 20+ rows
- 12+ alert conditions (thrust, divergence, rotation, ratio extremes, confluence)
- Fully customizable colors, thresholds, and visual elements


═══════════════════════════════════════════════════════════════════════════════
NOTES
═══════════════════════════════════════════════════════════════════════════════

This indicator is designed for experienced equity traders, portfolio managers, and market technicians familiar with:
- Market breadth analysis and internal market structure
- McClellan Oscillator interpretation
- New High - New Low dynamics and their correlation with market cycles
- Large-cap vs. small-cap rotation patterns
- Risk-On/Risk-Off regime identification

The framework provides objective breadth signals but does not account for:
- Fundamental catalysts (earnings, economic data, Fed policy)
- Sector-specific dynamics (may show broad weakness while certain sectors thrive)
- International market correlations
- Volatility regime changes (VIX dynamics)

Best used in combination with:
- Price action analysis (support/resistance, chart patterns)
- Volume analysis (accumulation/distribution)
- Volatility indicators (VIX, put/call ratios)
- Sentiment indicators (survey data, positioning)

Market breadth is a leading indicator of internal market health. Divergences between price and breadth often precede major reversals by weeks or months.


═══════════════════════════════════════════════════════════════════════════════

Developed for institutional market breadth analysis based on New Highs - New Lows methodology with extended participation breadth integration.

免責事項

この情報および投稿は、TradingViewが提供または推奨する金融、投資、トレード、その他のアドバイスや推奨を意図するものではなく、それらを構成するものでもありません。詳細は利用規約をご覧ください。