Sector Rotation & Stock Dashboard

905
Sector Rotation & Stock Dashboard puts a two-step screen in one table: first, how the 12 main NSE sector indices are performing against the benchmark; then, how the individual stocks of one sector are performing against their own sector. Look at the sectors first, then at the stocks inside the sector you care about.

All values are calculated from daily closes, so the table is the same on every chart timeframe. The script draws nothing on the price chart and gives no buy or sell signals.


WHAT YOU SEE

1. Sector board (top block)
• The 12 sector indices (Bank, IT, Pharma, Auto, FMCG, Metal, Realty, Energy, Financial Services, PSU Bank, Infra, Media), ranked by their 1D, 1W, 1M or 3M return.
• Returns shown relative to the benchmark (sector return minus benchmark return) or as absolute returns.
• Δ column: how many places each sector has moved up (▲) or down (▼) in the ranking compared with N sessions ago.
• Phase column: Leading, Weakening, Lagging or Improving (explained below).
• A benchmark row with the benchmark's own absolute returns.
• The sector whose stocks are listed below is marked with ◆. If the chart symbol is one of the sector indices, its row is highlighted.

2. Stock list (bottom block, or to the right in the "Side by side" layout)
• Up to 24 stocks of the selected sector.
• 1D, 1W and 1M returns.
• "Rel 50d" and "Rel 10d": the stock's return minus the sector index return (or minus the benchmark, if you choose) over the medium-term and short-term periods.
• Phase for each stock, using the same rule as the sectors.
• Distance from the daily EMA (default 50) in percent, marked ▲ above or ▼ below.
• A header line with the selected sector's own phase against the benchmark, and a footer counting how many of the sector's stocks are in each phase.
• If the chart symbol is in the list, its row is highlighted.


HOW THE PHASE IS CALCULATED

Two relative returns are calculated for each sector (against the benchmark) and for each stock (against its sector index or the benchmark):
• Medium-term relative return = own return over the medium-term period minus the base's return over the same period (default 50 sessions).
• Short-term relative return = the same over the short-term period (default 10 sessions).

The phase is the combination of their signs:
• Leading: medium-term ≥ 0 and short-term ≥ 0
• Weakening: medium-term ≥ 0, short-term < 0
• Lagging: medium-term < 0 and short-term < 0
• Improving: medium-term < 0, short-term ≥ 0

The four phase names are borrowed from the Relative Rotation Graph (RRG) concept developed by Julius de Kempenaer. This script does not use the RRG's JdK RS-Ratio or RS-Momentum formulas and does not draw a rotation graph. It uses plain return differences over two look-back periods, so every number in the table can be checked by hand.


WHAT IS DIFFERENT ABOUT IT

Most sector tools stop at the sector level, and most stock screeners compare every stock with the broad index. This script links the two levels in one view: it ranks the sectors, then measures each stock against its own sector index, so you can see which stocks are leading or lagging inside a sector that is itself leading or lagging. Filters by phase and by position against the daily EMA, three sort orders, and editable sector and stock lists are built in.


HOW TO USE IT

1. Add the script to any chart. The table appears in the top-right corner.
2. Settings → ① Stock list: choose the sector whose stocks you want to see, or set "Sector for the stock list" to "Chart symbol's sector". With the second option the script finds the chart's symbol in the stock lists (or among the sector indices) and lists that sector automatically. If a stock appears in more than one list, the first list wins.
3. Choose what the stocks are compared against: their sector index (default) or the benchmark.
4. Optional filters: show only certain phases (for example "Leading + Improving") and/or only stocks above their daily EMA.
5. Sort the stocks by phase then short-term relative strength (default), by medium-term relative strength, or by 1M return.
6. ② Sector board: choose the ranking period, relative or absolute returns, and the look-back for the rank change.
7. ⑥ Layout: Stacked (sectors above stocks), Side by side, Sectors only or Stocks only. Table position, text size and every colour can be changed.


SETTINGS AT A GLANCE

① Stock list: sector choice (manual or from the chart symbol), comparison base, phase filter, EMA filter and length, sort order
② Sector board: relative or absolute returns, ranking period, rank-change look-back, phase column on/off
③ Phase and benchmark: medium-term and short-term periods, benchmark symbol (NSE:NIFTY by default)
④ Sector indices: the 12 index symbols, editable
⑤ Stock lists: one comma-separated list per sector, up to 24 stocks each; "NSE:" is added automatically when no exchange is given
⑥ Layout and colours
All inputs are hidden from the status line.


LIMITATIONS

• The stock lists are fixed lists of large, well-known names in each sector, not the official index constituents, and they do not change over time (no point-in-time membership). Index constituents and ticker symbols change, so edit the lists in ⑤ when needed. Tickers that cannot be found are skipped, and the footer shows how many had no data.
• Sector indices differ in size, and some are dominated by a few heavyweight stocks.
• During the trading session the current day's values update with price; completed days do not change.
• Session counts approximate calendar periods; holidays shift the exact span.
• The script uses 37 of the 40 data requests a script may make (benchmark, 12 sectors, 24 stock slots), so lists longer than 24 stocks are cut at 24.
• Relative strength describes what has already happened. A phase is a description of past returns, not a forecast, and phases can change quickly.

This script is published for educational and informational purposes only. It does not provide investment advice, recommendations or signals to buy or sell any security. Past performance and relative strength do not guarantee future results.

Pernyataan Penyangkalan

Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.