PROTECTED SOURCE SCRIPT
מעודכן Index Top 5 Heavyweight Analyzer

## 🎯 Overview
This advanced Pine Script indicator applies the **Pareto Principle** to Nifty 50 trading: the top 5 heavyweights control 40%+ of the index's movement. Instead of watching all 50 stocks, this tool monitors the "Kings" that actually drive the index direction.
Professional traders don't trade the index in isolation - they look "under the hood" at heavyweight constituents. This indicator does exactly that, providing real-time analysis of HDFC Bank, Reliance, ICICI Bank, Bharti Airtel, and TCS to predict Nifty movements before they happen.
## 🔥 Key Features
### 1️⃣ Four-Quadrant OI Cycle Analysis
Identifies which cycle each heavyweight is in using Open Interest from continuous futures contracts:
- **Long Buildup** (Price ↑ + OI ↑): Institutions buying aggressively → Bullish driver
- **Short Covering** (Price ↑ + OI ↓): Bears trapped and exiting → Fast bullish spike
- **Short Buildup** (Price ↓ + OI ↑): Big money shorting → Bearish drag
- **Long Unwinding** (Price ↓ + OI ↓): Buyers giving up → Index weakness
### 2️⃣ Alignment Score System
Counts how many of the top 5 stocks are bullish/bearish/neutral. When 3+ heavyweights align in the same direction with sufficient weightage (15%+), the indicator generates high-conviction trade signals for the Nifty index.
### 3️⃣ Cost of Carry (Basis) Analysis
Compares Future vs Spot prices to gauge institutional sentiment:
- **Rising Premium**: Aggressive institutional buying
- **Discount (Backwardation)**: Extreme bearishness
### 4️⃣ Divergence Detection
Warns when the index move contradicts heavyweight signals - identifying "fake moves" that professional traders fade.
### 5️⃣ Actionable Trade Signals
- **Strong Bullish**: Buy Index Calls / Long Nifty Future
- **Strong Bearish**: Buy Index Puts / Short Nifty Future
- **Neutral/Choppy**: Iron Condor / Avoid Directional trades
## 📈 What Makes This Different?
Unlike basic index indicators, this tool:
- Fetches real Open Interest data from continuous futures (RELIANCE1!, HDFCBANK1!, etc.)[1][2]
- Applies weighted analysis - top 3 stocks matter most
- Provides professional trade recommendations based on constituent alignment
- Uses dark theme optimized colors for extended screen time
- Displays comprehensive dashboard with price, OI, OI change %, cycle status, and basis
## 💡 How to Use
1. **Add to any Nifty 50 or Bank Nifty chart**
2. **Watch the dashboard** in the top-right corner showing all 5 heavyweights
3. **Check the ALIGNMENT row**:
- 🔼 Bull Count | 🔽 Bear Count | ➖ Neutral Count
- Weighted Bull/Bear scores
4. **Read the INDEX SIGNAL row** for trade recommendations
5. **Look for divergence warnings** (⚠️) indicating fake moves
6. **Use the histogram plot** to visualize signal strength over time
## ⚙️ Customizable Settings
- **Constituents**: Modify ticker symbols and weightages
- **Signal Thresholds**: Adjust minimum alignment required (default: 3 out of 5)
- **Display Options**: Toggle table, signals, and basis calculations
- **Timeframe**: Works on all timeframes (intraday and daily)
## 🎨 Dark Theme Optimized
Designed specifically for TradingView's dark mode with:
- High-contrast colors that reduce eye strain
- Bright lime green (#00E676) for bullish signals
- Bright red (#FF5252) for bearish signals
- Electric colors for easy pattern recognition
## 📊 Best Used For
- **Nifty 50 Options Trading**: Know whether to buy calls or puts
- **Index Futures Trading**: Identify high-probability directional moves
- **Risk Management**: Avoid trading when heavyweights show divergence
- **Market Timing**: Enter when top stocks align (3+ in same direction)
## 🚀 Pro Tips
- **"Double Engine" Signal**: When Reliance shows Long Buildup AND HDFC Bank shows Short Covering → Extremely bullish for Nifty
- **Sector Rotation**: If Banks are strong but Tech is weak (or vice versa) → Expect choppy, range-bound index
- **Rollover Analysis**: Near expiry, watch for high OI with rising basis → Bulls/Bears carrying positions forward with confidence
## ⚠️ Important Notes
- Requires TradingView Premium for multiple `request.security()` calls
- OI data available only for stocks with active futures
- Best used on NSE exchange during market hours
- Combine with your own risk management strategy
## 📝 Credits
Based on professional institutional trading methodologies that analyze index constituents rather than the index itself. Implements the Pareto Principle: focus on the 20% (top 5 stocks) that drives 80% of the index movement.
***
## 🔔 Alerts Available
- Strong Bullish Signal (3+ stocks aligned bullish)
- Strong Bearish Signal (3+ stocks aligned bearish)
- Divergence Warning (fake index moves)
**Made for serious traders who want to trade like institutions - by watching what the "smart money" is doing in the heavyweights.**
***
*Optimize your Nifty trading by monitoring the stocks that actually matter. Stop watching all 50 - focus on the 5 Kings!* 👑
***
**Tags**: Nifty, Open Interest, OI Analysis, Heavyweight Analysis, Index Trading, Options Trading, Futures Trading, Institutional Analysis, Smart Money, Pareto Principle
This advanced Pine Script indicator applies the **Pareto Principle** to Nifty 50 trading: the top 5 heavyweights control 40%+ of the index's movement. Instead of watching all 50 stocks, this tool monitors the "Kings" that actually drive the index direction.
Professional traders don't trade the index in isolation - they look "under the hood" at heavyweight constituents. This indicator does exactly that, providing real-time analysis of HDFC Bank, Reliance, ICICI Bank, Bharti Airtel, and TCS to predict Nifty movements before they happen.
## 🔥 Key Features
### 1️⃣ Four-Quadrant OI Cycle Analysis
Identifies which cycle each heavyweight is in using Open Interest from continuous futures contracts:
- **Long Buildup** (Price ↑ + OI ↑): Institutions buying aggressively → Bullish driver
- **Short Covering** (Price ↑ + OI ↓): Bears trapped and exiting → Fast bullish spike
- **Short Buildup** (Price ↓ + OI ↑): Big money shorting → Bearish drag
- **Long Unwinding** (Price ↓ + OI ↓): Buyers giving up → Index weakness
### 2️⃣ Alignment Score System
Counts how many of the top 5 stocks are bullish/bearish/neutral. When 3+ heavyweights align in the same direction with sufficient weightage (15%+), the indicator generates high-conviction trade signals for the Nifty index.
### 3️⃣ Cost of Carry (Basis) Analysis
Compares Future vs Spot prices to gauge institutional sentiment:
- **Rising Premium**: Aggressive institutional buying
- **Discount (Backwardation)**: Extreme bearishness
### 4️⃣ Divergence Detection
Warns when the index move contradicts heavyweight signals - identifying "fake moves" that professional traders fade.
### 5️⃣ Actionable Trade Signals
- **Strong Bullish**: Buy Index Calls / Long Nifty Future
- **Strong Bearish**: Buy Index Puts / Short Nifty Future
- **Neutral/Choppy**: Iron Condor / Avoid Directional trades
## 📈 What Makes This Different?
Unlike basic index indicators, this tool:
- Fetches real Open Interest data from continuous futures (RELIANCE1!, HDFCBANK1!, etc.)[1][2]
- Applies weighted analysis - top 3 stocks matter most
- Provides professional trade recommendations based on constituent alignment
- Uses dark theme optimized colors for extended screen time
- Displays comprehensive dashboard with price, OI, OI change %, cycle status, and basis
## 💡 How to Use
1. **Add to any Nifty 50 or Bank Nifty chart**
2. **Watch the dashboard** in the top-right corner showing all 5 heavyweights
3. **Check the ALIGNMENT row**:
- 🔼 Bull Count | 🔽 Bear Count | ➖ Neutral Count
- Weighted Bull/Bear scores
4. **Read the INDEX SIGNAL row** for trade recommendations
5. **Look for divergence warnings** (⚠️) indicating fake moves
6. **Use the histogram plot** to visualize signal strength over time
## ⚙️ Customizable Settings
- **Constituents**: Modify ticker symbols and weightages
- **Signal Thresholds**: Adjust minimum alignment required (default: 3 out of 5)
- **Display Options**: Toggle table, signals, and basis calculations
- **Timeframe**: Works on all timeframes (intraday and daily)
## 🎨 Dark Theme Optimized
Designed specifically for TradingView's dark mode with:
- High-contrast colors that reduce eye strain
- Bright lime green (#00E676) for bullish signals
- Bright red (#FF5252) for bearish signals
- Electric colors for easy pattern recognition
## 📊 Best Used For
- **Nifty 50 Options Trading**: Know whether to buy calls or puts
- **Index Futures Trading**: Identify high-probability directional moves
- **Risk Management**: Avoid trading when heavyweights show divergence
- **Market Timing**: Enter when top stocks align (3+ in same direction)
## 🚀 Pro Tips
- **"Double Engine" Signal**: When Reliance shows Long Buildup AND HDFC Bank shows Short Covering → Extremely bullish for Nifty
- **Sector Rotation**: If Banks are strong but Tech is weak (or vice versa) → Expect choppy, range-bound index
- **Rollover Analysis**: Near expiry, watch for high OI with rising basis → Bulls/Bears carrying positions forward with confidence
## ⚠️ Important Notes
- Requires TradingView Premium for multiple `request.security()` calls
- OI data available only for stocks with active futures
- Best used on NSE exchange during market hours
- Combine with your own risk management strategy
## 📝 Credits
Based on professional institutional trading methodologies that analyze index constituents rather than the index itself. Implements the Pareto Principle: focus on the 20% (top 5 stocks) that drives 80% of the index movement.
***
## 🔔 Alerts Available
- Strong Bullish Signal (3+ stocks aligned bullish)
- Strong Bearish Signal (3+ stocks aligned bearish)
- Divergence Warning (fake index moves)
**Made for serious traders who want to trade like institutions - by watching what the "smart money" is doing in the heavyweights.**
***
*Optimize your Nifty trading by monitoring the stocks that actually matter. Stop watching all 50 - focus on the 5 Kings!* 👑
***
**Tags**: Nifty, Open Interest, OI Analysis, Heavyweight Analysis, Index Trading, Options Trading, Futures Trading, Institutional Analysis, Smart Money, Pareto Principle
הערות שחרור
## **📊 Index Heavyweight Analyzer - Pro Edition****Major Update: Institutional-Grade Signal Quality & Regime Detection**
### ✨ New Features
**🎯 Signal Quality Score (0-100)**
- Real-time confidence meter for every signal
- Analyzes alignment, weight distribution, trend purity & basis confirmation
- Auto-categorizes trades: Full Size (60-100) | Spreads Only (30-60) | No Trade (0-30)
- Distinguishes pure trends (LB) from short covering (SC) for better entry quality
**📈 Regime Filter**
- Detects market conditions: Trend Up | Trend Down | Choppy
- Uses ATR ratio & consecutive bar confirmation
- Recommends optimal option structures based on regime:
- Trend regimes → Directional (Calls/Puts, Spreads)
- Choppy regimes → Non-directional (Iron Condor, Straddle)
**⚡ Performance Optimization**
- Reduced API calls by 50% (63→33) - now works on all TradingView plans
- Faster execution with batched data requests
- Toggle features on/off to manage API limits
### 📋 What It Shows
Tracks 10 Nifty heavyweights (HDFC, Reliance, ICICI, Bharti, TCS, SBI, Infy, HUL, Axis, Adani) with OI cycle analysis, basis tracking, weighted signals, and now **confidence scoring** for smarter options trading.
**Perfect for:** Options traders seeking high-probability setups with institutional-grade analytics.
***
הערות שחרור
Minor fixסקריפט מוגן
סקריפט זה פורסם כמקור סגור. עם זאת, תוכל להשתמש בו בחופשיות וללא כל מגבלות – למד עוד כאן
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
סקריפט מוגן
סקריפט זה פורסם כמקור סגור. עם זאת, תוכל להשתמש בו בחופשיות וללא כל מגבלות – למד עוד כאן
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.