PROTECTED SOURCE SCRIPT
Actualizado

Nifty Market Breadth Analyzer

391
# 📊 Nifty Market Breadth Analyzer

## Overview
Professional-grade market breadth indicator specifically designed for Indian equity markets (NSE). Analyzes strength across 7 major Nifty indices to provide comprehensive market health assessment and timing signals.

## 🎯 Key Features

### Multi-Index Analysis
- Tracks Nifty 50, CNX 500, Bank Nifty, Midcap 150, Smallcap 250, Microcap 250
- Calculates composite breadth score (0-100%)
- Shows participation rate (how many indices are strong)

### Smart Signal Generation
- **Entry Signals**: When breadth crosses bullish threshold (60%)
- **Exit Signals**: When breadth weakens below neutral (40%)
- **Strong Signals**: Extreme strength/weakness alerts (>70% or <30%)
- **Bottom Detection**: Automatic identification of market capitulation & recovery

### Divergence Detection
- **Bullish Divergence**: Price falling but breadth improving (bottom forming)
- **Bearish Divergence**: Price rising but breadth weakening (rally losing steam)

### Visual Dashboard
- Real-time breadth score with color coding
- Individual index status (✓ or ✗ above MA)
- Current market condition (Strong Bullish to Strong Bearish)
- Trading signal recommendation (GO LONG, EXIT ALL, WAIT)
- Trend direction (Rising/Falling/Stable)

## 📈 Use Cases

✅ **Bottom Hunting**: Identify capitulation zones and reversal points
✅ **Trend Confirmation**: Enter only when broad market supports the move
✅ **Risk Management**: Exit when breadth deteriorates even if price holds
✅ **Market Analysis**: Distinguish between narrow and broad-based rallies
✅ **Divergence Trading**: Catch reversals before price confirms

## 🧮 Methodology

The indicator calculates a composite score for each index based on:
1. **Trend**: Is price above 50-period moving average?
2. **Momentum**: Is 14-period RSI above 50?
3. **Acceleration**: Is 20-period rate of change positive?

Final breadth = Average score across all enabled indices

## ⚙️ Customization

**Thresholds**: Adjust bullish/bearish levels to match your risk tolerance
**Indices**: Select which indices to include in calculation
**Technical**: Modify MA length, RSI period, smoothing
**Visual**: Toggle histogram, signals, zones, and dashboard

## 📊 Interpretation Guide

| Breadth Score | Condition | Action |
|--------------|-----------|---------|
| 70-100% | 🚀 Strong Bullish | Add positions, hold long |
| 60-70% | 📈 Bullish | Safe to enter long |
| 40-60% | ➡️ Neutral | Wait for clarity |
| 30-40% | 📉 Bearish | Exit longs, reduce exposure |
| 0-30% | ⚠️ Strong Bearish | Exit all, watch for bottom |

## 🎓 Best Practices

1. **Don't fight breadth**: Avoid going long when breadth < 40%
2. **Wait for confirmation**: Multiple indices must turn positive
3. **Use with price action**: Combine with support/resistance levels
4. **Set alerts**: Get notified of breadth changes in real-time
5. **Monitor divergences**: These often precede major reversals

## 🔔 Recommended Alerts

- Market Bottom Confirmed (breadth recovers from <30%)
- Breadth Entry Signal (crosses above 60%)
- Breadth Exit Signal (crosses below 40%)
- Bullish/Bearish Divergence Detected

## 💡 Pro Tips

- Extreme breadth (<30%) often marks capitulation bottoms
- 5+ indices above MA = healthy broad-based rally
- Rising breadth + falling price = excellent buying opportunity
- Falling breadth + rising price = distribution warning

## 🌐 Best For

- Intraday traders (use on 5-15 min timeframes)
- Swing traders (use on 1-hour to daily)
- Position traders (use on daily to weekly)
- Portfolio managers monitoring market health

## ⚠️ Important Notes

- Ensure symbol names match your data provider
- Works best on Nifty 50 chart or related indices
- Not suitable for individual stock analysis
- Past performance doesn't guarantee future results

## 📞 Support & Updates

Found this helpful? Please boost, comment, and follow for updates!
Suggestions welcome - continuously improving based on user feedback.

---

**Version**: 1.0
**Last Updated**: [Current Date]
**Indicator Type**: Market Breadth / Oscillator
**Timeframe**: All (optimized for 15min+)
Notas de prensa

Major Logic Enhancements:

Z-Score Dynamic Thresholds: Added statistical analysis to identify Overbought/Oversold conditions relative to recent volatility.
Example: Z-Score > +2.0 indicates the market is statistically overextended (Risk of Pullback).
Example: Z-Score < -2.0 indicates the market is statistically washed out (Potential Bounce Opportunity).
Sector Relative Strength (RS): New "Leaders" dashboard section showing if Bank, Midcap, or Smallcap indices are outperforming the Nifty 50 benchmark.
Market Regime Filter: Added a Trend Filter (default 50 EMA) on Nifty 50. Buy signals are now smarter and check if the broader market trend is Bullish.
Updated Defaults: Changed default Moving Average to EMA (from SMA) and Regime Filter to 50 Period for better medium-term responsiveness.
Visual & UI Improvements:

Smoother Signals: Applied WMA Smoothing (default 9) to the main breadth line to reduce noise and "jitter".
Smart Dashboard: Enhanced info table with Z-Score values, Regime Status (Bull/Bear), and Sector Leader arrows.
Cleaner Signals:
Replaced text labels with clean Symbols: "B" (Buy), "S" (Sell), and "★" (Strong Signal).
Added ▲/▼ Arrows for Signal Line crossovers to spot trend changes easily.
Customization: Added a full "Color Theme" section in settings to customize the Signal Line and all Breadth zones (Strong Bull, Bull, Neutral, Bear, Strong Bear).
Clutter Reduction: Removed obsolete signals to keep the chart clean.

Exención de responsabilidad

La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.