OPEN-SOURCE SCRIPT
BANKNIFTY Contribution Table [GSK-VIZAG-AP-INDIA]

1. Overview
This indicator provides a real-time visual contribution table of the 12 constituent stocks in the BANKNIFTY index. It displays key metrics for each stock that help traders quickly understand how each component is impacting the index at any given moment.
2. Purpose / Trading Use Case
The tool is designed for intraday and short-term traders who rely on index movement and its internal strength or weakness. By seeing which stocks are contributing positively or negatively, traders can:
Confirm trend strength or divergence within the index.
Identify whether a BANKNIFTY move is broad-based or driven by a few heavyweights.
Detect reversals when individual components decouple from index direction.
3. Key Features and Logic
Live LTP: Current price of each BANKNIFTY stock.
Price Change: Difference between current LTP and previous day’s close.
% Change: Percentage move from previous close.
Weight %: Static weight of each stock within the BANKNIFTY index (user-defined).
This estimates how much each stock contributes to the BANKNIFTY’s point change.
Sorted View: The stocks are sorted by their weight (descending), so high-impact movers are always at the top.
4. User Inputs / Settings
Table Position (tableLocationOpt):
Choose where the table appears on the chart:
top_left, top_right, bottom_left, or bottom_right.
This helps position the table away from your price action or indicators.
5. Visual and Plotting Elements
Table Layout: 6 columns
Stock | Contribution | Weight % | LTP | Change | % Change
Color Coding:
Green/red for positive/negative price changes and contributions.
Alternating background rows for better visibility.
BANKNIFTY row is highlighted separately at the top.
Text & Background Colors are chosen for both readability and direction indication.
6. Tips for Effective Use
Use this table on 1-minute or 5-minute intraday charts to see near real-time market structure.
Watch for:
A few heavyweight stocks pulling the index alone (can signal weak internal breadth).
Broad green/red across all rows (signals strong directional momentum).
Combine this with price action or volume-based strategies for confirmation.
Best used during market hours for live updates.
7. What Makes It Unique
Unlike other contribution tables that show only static data or require paid feeds, this script:
Updates in real time.
Uses dynamic calculated contributions.
Places BANKNIFTY at the top and presents the entire internal structure clearly.
Doesn’t repaint or rely on lagging indicators.
8. Alerts / Additional Features
No alerts are added in this version.
(Optional: Alerts can be added to notify when a certain stock contributes above/below a threshold.)
9. Technical Concepts Used
request.security() to pull both 1-minute and daily close data.
Conditional color formatting based on price change direction.
Dynamic table rendering using table.new() and table.cell().
Static weights assigned manually for BANKNIFTY stocks (can be updated if index weights change).
10. Disclaimer
This script is intended for educational and informational purposes only. It does not constitute financial advice or a buy/sell recommendation.
Users should test and validate the tool on paper or demo accounts before applying it to live trading.
📌 Note: Due to internet connectivity, data delays, or broker feeds, real-time values (LTP, change, contribution, etc.) may slightly differ from other platforms or terminals. Use this indicator as a supportive visual tool, not a sole decision-maker.
Script Title: BANKNIFTY Contribution Table - [GSK-VIZAG-AP-INDIA]
Author: GSK-VIZAG-AP-INDIA
Version: Final Public Release
This indicator provides a real-time visual contribution table of the 12 constituent stocks in the BANKNIFTY index. It displays key metrics for each stock that help traders quickly understand how each component is impacting the index at any given moment.
2. Purpose / Trading Use Case
The tool is designed for intraday and short-term traders who rely on index movement and its internal strength or weakness. By seeing which stocks are contributing positively or negatively, traders can:
Confirm trend strength or divergence within the index.
Identify whether a BANKNIFTY move is broad-based or driven by a few heavyweights.
Detect reversals when individual components decouple from index direction.
3. Key Features and Logic
Live LTP: Current price of each BANKNIFTY stock.
Price Change: Difference between current LTP and previous day’s close.
% Change: Percentage move from previous close.
Weight %: Static weight of each stock within the BANKNIFTY index (user-defined).
This estimates how much each stock contributes to the BANKNIFTY’s point change.
Sorted View: The stocks are sorted by their weight (descending), so high-impact movers are always at the top.
4. User Inputs / Settings
Table Position (tableLocationOpt):
Choose where the table appears on the chart:
top_left, top_right, bottom_left, or bottom_right.
This helps position the table away from your price action or indicators.
5. Visual and Plotting Elements
Table Layout: 6 columns
Stock | Contribution | Weight % | LTP | Change | % Change
Color Coding:
Green/red for positive/negative price changes and contributions.
Alternating background rows for better visibility.
BANKNIFTY row is highlighted separately at the top.
Text & Background Colors are chosen for both readability and direction indication.
6. Tips for Effective Use
Use this table on 1-minute or 5-minute intraday charts to see near real-time market structure.
Watch for:
A few heavyweight stocks pulling the index alone (can signal weak internal breadth).
Broad green/red across all rows (signals strong directional momentum).
Combine this with price action or volume-based strategies for confirmation.
Best used during market hours for live updates.
7. What Makes It Unique
Unlike other contribution tables that show only static data or require paid feeds, this script:
Updates in real time.
Uses dynamic calculated contributions.
Places BANKNIFTY at the top and presents the entire internal structure clearly.
Doesn’t repaint or rely on lagging indicators.
8. Alerts / Additional Features
No alerts are added in this version.
(Optional: Alerts can be added to notify when a certain stock contributes above/below a threshold.)
9. Technical Concepts Used
request.security() to pull both 1-minute and daily close data.
Conditional color formatting based on price change direction.
Dynamic table rendering using table.new() and table.cell().
Static weights assigned manually for BANKNIFTY stocks (can be updated if index weights change).
10. Disclaimer
This script is intended for educational and informational purposes only. It does not constitute financial advice or a buy/sell recommendation.
Users should test and validate the tool on paper or demo accounts before applying it to live trading.
📌 Note: Due to internet connectivity, data delays, or broker feeds, real-time values (LTP, change, contribution, etc.) may slightly differ from other platforms or terminals. Use this indicator as a supportive visual tool, not a sole decision-maker.
Script Title: BANKNIFTY Contribution Table - [GSK-VIZAG-AP-INDIA]
Author: GSK-VIZAG-AP-INDIA
Version: Final Public Release
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
"Created by GSK-VIZAG-AP-INDIA"
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
"Created by GSK-VIZAG-AP-INDIA"
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.