Stocks vs Sector Leaderboard**Stocks vs Sector Leaderboard** compares the performance of up to 10 selected stocks against a sector index or other benchmark.
The indicator is designed to quickly show which stocks are **outperforming or underperforming their sector** over a configurable lookback period.
The default configuration compares a selection of ASX Energy stocks against the **S&P/ASX 200 Energy Index (XEJ)**, but both the stocks and benchmark are fully configurable.
**How it works**
For each selected stock, the indicator:
* Calculates performance over the selected number of bars.
* Calculates the benchmark's performance over the same period.
* Calculates relative performance as **Stock Performance − Sector Performance**.
* Estimates market capitalization using the latest available shares outstanding and current share price.
* Ranks the selected stocks by estimated market capitalization.
* Displays the results in a configurable leaderboard directly on the chart.
A positive **vs Sector** value means the stock has outperformed the benchmark over the selected period. A negative value means it has underperformed.
The lookback uses the **current chart timeframe**. For example, a lookback of 60 means 60 daily bars on a daily chart, 60 hourly bars on a 1-hour chart, or 60 weekly bars on a weekly chart.
**Configuration**
The indicator allows you to configure the benchmark, up to 10 stock symbols, performance lookback, table position, font size, normal text color, outperforming color, and underperforming color.
Although the default configuration uses ASX Energy stocks and XEJ, the indicator can be used with other sectors, indices, exchanges, or groups of stocks by changing the symbols in the settings.
**PulseWire request limit**
The indicator intentionally supports a maximum of **10 stocks** because it needs to retrieve external price and financial data for each symbol using Pine Script `request.*()` functions.
PulseWire imposes limits on the number of unique `request.*()` calls a script may make. On plans with a **40 unique-request limit**, increasing the number of stocks can cause the script to exceed that limit and fail to execute.
Because request limits and access to financial data can depend on the user's PulseWire plan, **this indicator may not work, or may have limited functionality, on PulseWire's free plan**.
**Note**
Market capitalization is an estimate based on share price and the latest shares-outstanding data available through PulseWire. It should be used for ranking and comparison rather than as an authoritative real-time market-cap figure.
This indicator is intended as an analysis tool and does not provide trading or investment advice.
Indicator

Sector Rotation (Zeiierman)█ Overview
Sector Rotation (Zeiierman) is a relative strength rotation tool designed to compare multiple sectors against a selected benchmark and visualize how leadership shifts across the market over time.
Instead of viewing sector performance as isolated price charts, the script converts each sector into a normalized RS-Ratio and RS-Momentum reading, then plots them inside a four-quadrant rotation map.
The result is a clean visual framework for identifying which sectors are Leading, Weakening, Lagging, or Recovering relative to the broader market.
█ How It Works
⚪ Relative Strength Rotation Engine
Each sector is measured against a benchmark symbol, such as VTI or SPY, by dividing the sector’s price by the benchmark price.
ratio = sc / benchClose
This relative strength ratio is normalized into an RS-Ratio value centered around 100. A second momentum calculation measures the rate of change of that RS-Ratio and normalizes it into RS-Momentum, also centered around 100.
rsr = 100.0 + (ratio - basis) / sd
roc = rsr - rsr
rsm = 100.0 + (roc - mb) / msd
Together, these two values create the X and Y coordinates for each sector:
• RS-Ratio above 100 → relative strength is above average
• RS-Ratio below 100 → relative strength is below average
• RS-Momentum above 100 → relative momentum is improving
• RS-Momentum below 100 → relative momentum is weakening
⚪ Four-Quadrant Rotation Map
The chart is divided into four market rotation phases:
phase(float x, float y) =>
x >= 100 and y >= 100 ? "Leading" :
x < 100 and y >= 100 ? "Recovering" :
x < 100 and y < 100 ? "Lagging" :
"Weakening"
• Leading → strong relative strength and rising momentum
• Weakening → strong relative strength but falling momentum
• Lagging → weak relative strength and falling momentum
• Recovering → weak relative strength but improving momentum
This allows traders to quickly understand where each sector currently sits in the rotation cycle.
⚪ Sector Trails and Movement Directio n
Each sector keeps a synchronized historical trail of recent RS-Ratio and RS-Momentum points.
ax.unshift(x)
ay.unshift(y)
if ax.size() > tailLen
ax.pop()
ay.pop()
The newest point is displayed as the sector head marker, while older points form a fading tail behind it. This makes it easier to see not only where a sector is now, but also how it has been rotating over recent samples.
The table also shows each sector’s current heading, such as RS improving, RS weakening, momentum rising, or momentum falling.
dx = ax.get(0) - ax.get(1)
dy = ay.get(0) - ay.get(1)
⚪ Top-Ranked Sector Filtering
The script includes an optional ranking system that can display only the most important sector rotations.
Sectors can be ranked by:
• Fastest movement
• Movement toward Leading
• Movement toward Recovering
• Movement toward Lagging
• Movement toward Weakening
score(array ax, array ay) =>
rankMode == "Fastest movement"
? speed(ax, ay)
: target(ax, ay, rankMode)
When enabled, only the top-ranked sectors are shown on the chart and in the table, helping reduce clutter and focus attention on the most actionable rotations.
selected(int id, bool en) =>
en and (
not useRanking or
rankOf(id) <= topRankN
)
█ How to Use
⚪ Identify Sector Leadership
Look for sectors positioned in the Leading quadrant. These sectors have both strong relative strength and improving momentum compared to the benchmark. Sectors moving into Leading from Recovering can signal early leadership development.
⚪ Watch Weakening Sectors
Sectors in the Weakening quadrant still have above-average relative strength, but their momentum is declining. This can indicate that prior leaders are beginning to lose strength.
⚪ Track Recovering Rotations
Sectors in the Recovering quadrant have below-average relative strength but improving momentum. These areas may represent early rotation opportunities before relative strength fully turns positive.
⚪ Avoid or Monitor Lagging Sectors
Sectors in the Lagging quadrant show both weak relative strength and weak momentum. These sectors are typically underperforming the benchmark and may remain weak until momentum begins to improve.
⚪ Example: Ranked by Fastest Movement
In this example, the ranking mode is set to Fastest Movement with Only Show Top Ranked enabled and Top X = 5.
The indicator measures how quickly each sector is moving through the rotation cycle by comparing the change in its RS-Ratio and RS-Momentum values between samples. Sectors with the largest movement are ranked highest and displayed on the chart.
As a result, only the five sectors showing the strongest relative movement are visible. In this case, all five sectors are positioned inside the Recovering quadrant, indicating that relative momentum has turned positive while relative strength remains slightly below average.
The upward and rightward trajectory of the trails suggests these sectors are improving versus the benchmark and may continue rotating toward the Leading quadrant if current momentum persists.
⚪ Example: Top 5 Sectors Ranked Toward Leading
In this example, the ranking mode is set to Toward Leading with Only Show Top Ranked enabled and Top X = 5.
Rather than ranking sectors by raw speed, the indicator prioritizes sectors moving most directly toward the Leading quadrant, where both relative strength and relative momentum are above the 100 baseline.
Technology currently holds the highest rank, as it has already entered the Leading quadrant with both RS-Ratio and RS-Momentum above 100. Its trail shows a strong and sustained rotation from weaker relative conditions into market leadership, making it the strongest candidate according to the selected ranking method.
Discretionary and Financials are positioned inside the Recovering quadrant. Although they have not yet reached leadership status, their improving momentum and trajectory toward the upper-right portion of the chart suggest continued relative improvement versus the benchmark.
Meanwhile, Staples and Real Estate remain in the Lagging quadrant. However, they are still included in the ranking because their recent movement is directed toward the Leading quadrant, indicating potential early-stage rotation despite their current relative weakness.
This ranking mode is particularly useful for identifying sectors that are not necessarily the strongest today, but are showing the most meaningful progress toward future leadership. By focusing on directional rotation rather than speed alone, traders can often spot emerging leaders before they fully establish themselves in the Leading quadrant.
⚪ Example: Top 5 Sectors Ranked Toward Recovering
In this example, the ranking mode is set to Toward Recovering with Only Show Top Ranked enabled and Top X = 5.
This ranking method prioritizes sectors moving most directly toward the Recovering quadrant, where relative strength remains below average but relative momentum is improving. The goal is to identify sectors that may be emerging from periods of relative underperformance and beginning a new rotation cycle.
Communication Services holds the highest rank in this example. Its trail shows a strong upward movement from the Lagging quadrant into Recovering, indicating a significant improvement in relative momentum while still trading below the relative strength baseline.
Consumer Staples and Real Estate also display characteristics of sectors transitioning toward recovery. Their recent movement suggests momentum is improving despite their relative strength remaining below average.
Technology appears in the Leading quadrant, while Energy remains in Lagging. Although they occupy different quadrants, both are included because their recent directional movement aligns with the path toward the Recovering quadrant based on the ranking algorithm.
This ranking mode is particularly useful for traders seeking early rotation opportunities. Rather than focusing on sectors that are already leading, it highlights areas of the market where momentum is beginning to improve and where relative strength may eventually follow if the recovery continues.
⚪ Example: Top 5 Sectors Ranked Toward Lagging
In this example, the ranking mode is set to Toward Lagging with Only Show Top Ranked enabled and Top X = 5.
This ranking method prioritizes sectors moving most directly toward the Lagging quadrant, where both relative strength and relative momentum fall below the 100 baseline. It helps identify sectors that are losing leadership, weakening relative to the benchmark, or entering periods of sustained underperformance.
Technology and Health Care are currently positioned inside the Weakening quadrant. Both sectors still maintain above-average relative strength, but their declining momentum suggests they are rotating away from leadership and moving closer toward Lagging conditions.
Meanwhile, Staples, Utilities, and Real Estate remain within the Recovering quadrant. Although momentum is still positive, their relative strength remains below average. Their inclusion in the ranking reflects the direction of their recent movement rather than their current location, indicating they are rotating toward weaker relative conditions.
The trails highlight this transition clearly, with several sectors showing movement away from stronger quadrants and toward areas associated with declining performance.
This ranking mode is useful for identifying sectors that may be losing institutional sponsorship, weakening relative to the broader market, or approaching the later stages of the relative strength cycle. Traders can use it to spot deteriorating leadership and monitor sectors that may continue underperforming if current trends persist.
⚪ Example: Top 5 Sectors Ranked Toward Weakening
In this example, the ranking mode is set to Toward Weakening with Only Show Top Ranked enabled and Top X = 5.
This ranking method prioritizes sectors moving most directly toward the Weakening quadrant, where relative strength remains above average but relative momentum has begun to deteriorate. These sectors often represent former leaders that are losing momentum before potentially transitioning into the Lagging quadrant.
Technology holds the highest rank in this example. While its relative strength remains above the 100 baseline, its momentum has fallen below 100, placing it firmly inside the Weakening quadrant. Its recent trail illustrates a loss of momentum despite previously strong relative performance, making it a textbook example of a sector rotating away from leadership.
Health Care remains in the Leading quadrant but is also ranked highly because its recent movement is directed toward Weakening. Although it continues to outperform the benchmark, the decline in momentum suggests its leadership position may be starting to fade.
Materials is already positioned within the Weakening quadrant, while Energy and Real Estate remain in Recovering. Their inclusion reflects the direction of their recent movement rather than their current location, indicating they are rotating toward conditions associated with weakening relative performance.
This ranking mode is useful for identifying sectors that may be nearing the end of their leadership cycle. Traders often monitor these sectors for signs of continued momentum deterioration, profit-taking activity, or a potential transition into the Lagging quadrant if relative strength begins to weaken further.
█ Settings
Benchmark: Selects the symbol each sector is compared against.
Calculation Timeframe: Defines the timeframe used for all relative strength and momentum calculations.
RS-Ratio Lookback: Controls the normalization period for relative strength.
RS-Momentum Lookback: Controls how quickly momentum responds to changes in RS-Ratio.
Tail Length: Sets how many historical samples are shown behind each sector.
Sample Every N Bars: Controls how frequently new trail points are recorded.
Show Sector Table: Shows or hides the summary table with phase, heading, RS, and momentum values.
Only Show Top Ranked: Enables filtering so only the strongest ranked sectors are displayed.
Top X: Defines how many ranked sectors remain visible.
Rank By: Selects how sectors are ranked, either by speed or movement toward a selected quadrant.
Sector Inputs: Allows each sector to be enabled, disabled, customized, or replaced with another symbol.
Canvas Width: Controls the horizontal size of the rotation map.
Canvas Height: Controls the vertical size of the rotation map.
Symmetric Bounds Around 100: Keeps the chart balanced around the 100 baseline.
Minimum Axis Span: Prevents small movements from being visually exaggerated.
-----------------
Disclaimer
The content provided in my scripts, indicators, ideas, algorithms, and systems is for educational and informational purposes only. It does not constitute financial advice, investment recommendations, or a solicitation to buy or sell any financial instruments. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
Indicator

Nifty Breadth [Top 20 Movers]This is a comprehensive, real-time market breadth dashboard for the NSE (National Stock Exchange of India), tracking 40 (out of 50) of the most prominent Nifty stocks across 9 sectors. It displays the top 20 gainers and losers, advance/decline statistics, and sector-level breadth — all inside a single, elegantly formatted overlay table.
Key Features:-
Performance Mode — The indicator supports both Daily and Weekly timeframes, switchable via a simple dropdown input. This allows traders to instantly toggle between intraday close-to-close and week-over-week performance views without modifying any code.
Top 20 Movers Panel — The dashboard ranks all 40 (out of 50) tracked stocks by percentage change and displays the top 10 gainers and top 10 losers in a two-column layout each, making it easy to spot the strongest and weakest names at a glance. Each row shows the stock symbol, percentage change (with sign), and a proportional block bar that visually represents the magnitude of the move.
Emoji Highlights — The top gainer is flagged with a 🔥 icon and the steepest loser with a ❄️ icon, making the outliers immediately identifiable. This feature can be toggled on or off from the settings.
Advance / Decline Breadth Panel — A dedicated panel summarizes market sentiment across all 40 stocks, showing the raw count of advances, declines, and unchanged stocks, their percentage breakdown, and a 10-block visual bar that fills green for advancing and red for declining proportion.
Sector Breadth Panel — All 40 stocks are mapped to one of 9 sectors — Banking, IT, Auto, Pharma, Energy, Metals, FMCG, Infra, and Miscellaneous. For each sector, the dashboard shows how many constituent stocks are advancing versus declining, color-coded with unique accent colors per sector for quick visual separation.
Customization Options
The indicator exposes several user-facing inputs to personalize the display without touching the code. The table position can be placed at any of nine screen locations. Bar scale percentage and maximum block count control the visual width of the performance bars. Text sizes for the title, headers, and data rows can be independently set to Tiny, Small, Normal, or Large, making the dashboard adaptable to different screen resolutions and chart layouts.
Technical Implementation: -
The script uses request.security() calls to fetch close prices across all 40 symbols on the selected timeframe, calculates percentage change relative to the prior bar, and stores results in arrays. It then uses array.sort_indices() to rank stocks in both ascending and descending order for the gainers and losers panels respectively. The entire table is rendered only on the last bar using barstate.islast to avoid redundant rendering. A timestamp in IST (Asia/Kolkata) is shown in the footer.
Usage Notes:-
This indicator is designed as an overlay on any NSE chart. It does not generate buy or sell signals — it is a purely market breadth and sentiment monitoring tool intended to give Indian traders a structured, data-rich overview of the Nifty universe in a single view. Best used as a companion panel on a dedicated blank chart or index chart window. Enjoy !!
Indicator

Sector Divergence DashboardStatistical arbitrage dashboard for markets and sector ETFs
This Sector Divergence Dashboard is a tool designed to identify mean-reversion opportunities across U.S. equity sectors. I've built it to help me with portfolio management and sector allocation by identifying uncorrelated sectors and divergences between indices and sector ETFs. These divergences are often good investment opportunities.
The indicator also helps you with sector rotation by identifying when sectors have diverged too far from their historical relationships with the broader market. This is a similar methodology used daily in institutional portfolio management and hedge funds.
In this dashboard, you can see:
Z-Score Analysis on log price ratios to detect statistical anomalies
Dual-timeframe correlation tracking to identify relationship breakdowns
Composite scoring that combines divergence magnitude, correlation shifts, and momentum
Correlation heatmap for instant relationship assessment across all pairs
You see exactly which pairs are statistically mispriced and likely to revert to their historical mean.
NOTE: This dashboard is computationally heavy and might take up to one minute to load in your PulseWire.
The Mathematics
1. Price Ratio Z-Score
The indicator calculates the logarithmic price ratio between two assets (e.g., SPY/XLE) and measures how many standard deviations this ratio has moved from its historical average. A z-score of +2.0 means the pair is 2 standard deviations expensive relative to history. This can be a mean-reversion setup.
2. Correlation Breakdown Detection
Short-term correlation (35 bars) is compared against long-term correlation (100 bars). You can change these parameters BTW. When correlations diverge significantly, it signals that the normal relationship has temporarily broken, potentially creating trading opportunities.
3. Relative Performance
Measures the momentum difference between pairs over 300 bars (roughly 60 weeks on daily charts). This captures longer-term structural shifts versus short-term noise.
4. Composite Score
All three metrics are normalized and weighted to create a single ranking score:
50% Z-Score Weight - Primary driver of mean reversion probability
25% Correlation Breakdown - Relationship stability metric
25% Relative Performance - Momentum/trend context
Features
1. Correlation Heatmap
Visualize all pairwise correlations
Color-coded from red (negative correlation) to green (strong positive)
Spot which sectors are moving together or decoupling
2. Divergence Rankings Table
Top 15 SPY-vs-sector pairs ranked by composite opportunity score
Z-scores, correlations, performance differentials, and signals
Color-coded from gray (neutral) to red (extreme divergence)
Scan it daily for setups
3. Deep Dive Chart
Detailed z-score visualization for any selected pair
Visual zones showing normal range, signal threshold, and strong signal areas
Short-term and long-term correlation overlays
Real-time information label with current metrics and signal status
Perfect for analyzing specific opportunities in depth
You can define which symbols you want to deep dive in the parameters
Parameter Guide
Short-Term Correlation - Recent relationship strength
Long-Term Correlation - Historical baseline relationship
Z-Score Length - Mean reversion lookback period
Relative Performance - Longer-term momentum context
Pro Tip : Increase z-score length to 150+ for fewer but stronger signals. Decrease to 50-75 for more frequent opportunities (but more noisy).
Use Cases
Sector Rotation: Identify which sectors are over/undervalued relative to the market
Portfolio Rebalancing: Data-driven signals for tactical asset allocation adjustments
Pairs Trading: Statistical arbitrage between correlated instruments
Risk Management: Monitor correlation stability across your portfolio
Market Regime Detection: Spot when sector relationships are breaking down
Swing Trading: Mean-reversion setups with clear entry/exit rules
Example:
XLK, a key tech ETF, is typically very correlated with the S&P 500 with a 0.88 correlation. Our dashboard detected a divergence between both, which signals a buy/rotation to XLK.
Let me know if you have any requests, improvements suggestions or feedback :) Indicator

Indian Equities Theme Tracker [EWT] - Sector Rotation HeatmapIdentify where the "Smart Money" is flowing in the Indian Markets.
The Indian Equities Theme Tracker is a powerful visual dashboard designed for NSE traders and investors to monitor sector rotation and relative strength in real-time. By tracking the most liquid Exchange Traded Funds (ETFs), this tool provides a birds-eye view of the Indian economy—from core benchmarks like Nifty 50 and Nifty 500 to high-growth themes like Defence, EV, Tourism, and Energy.
In modern markets, capital doesn't move into all stocks at once; it rotates between sectors. This script helps you spot the leaders and laggards across five different timeframes, ensuring you are always positioned in the strongest themes.
🚀 Key Features :
23+ Essential Themes: Tracks Broad Market, Market Caps (Mid/Small), Sectors (IT, Bank, Auto, Metal), and Narratives (Defence, Tourism, EV, Energy).
Dynamic Performance Sorting: Automatically reorders the table based on your selected lookback (1 Day, 1 Week, 1 Month, 3 Months, or YTD).
Heatmap Logic: Intuitive color coding helps you instantly identify extreme bullishness or bearishness across the board.
Liquidity Focused: Uses the most liquid NSE ETFs (BeES and equivalent) to ensure the data is accurate and reflects tradeable prices.
Pro UI Design: A clean, professional dashboard that can be positioned anywhere on your chart without cluttering your price action analysis.
📊 Themes Included :
Benchmarks: Nifty 500, Nifty 50, Nifty Next 50.
Market Caps: Midcap 150, Smallcap 250.
Sectors: Private & PSU Banks, IT, Pharma, Healthcare, FMCG, Auto, Metals, Infra, Realty.
Thematic/Narratives: Defence, Tourism, Energy, EV & New Age Automotive, Consumption.
Safe Havens: Gold & Silver.
🛠️ How to use :
Timeframe: Switch to the Daily (D) timeframe for the best results.
Settings: Use the inputs to change the table position (Top/Middle/Bottom) and the sorting criteria.
Strategy: Look for themes that are consistently at the top of the "1 Month" and "3 Month" lists—these are your structural leaders. Use "1 Day" to spot quick tactical bounces.
Disclaimer: This indicator is for educational and informational purposes only and does not constitute financial advice. Always perform your own due diligence. Indicator

Sector Rotation & Money Flow Dashboard📊 Overview
The Sector Rotation & Money Flow Dashboard is a comprehensive market analysis tool that tracks 39 major sector ETFs in real-time, providing institutional-grade insights into sector rotation, momentum shifts, and money flow patterns. This indicator helps traders identify which sectors are attracting capital, which are losing favor, and where the next opportunities might emerge.
Perfect for swing traders, position traders, and investors who want to stay ahead of sector rotation and ride the strongest trends while avoiding weak sectors.
🎯 What This Indicator Does
Tracks 39 Major Sectors: From technology to utilities, cryptocurrencies to commodities
Calculates Multiple Timeframes: 1-week, 1-month, 3-month, and 6-month performance
Advanced Momentum Metrics: Proprietary momentum score and acceleration calculations
Relative Strength Analysis: Compare sector performance against any benchmark index
Money Flow Signals: Visual indicators showing where institutional money is moving
Smart Filtering: Pre-built strategy filters for different trading styles
Trend Detection: Emoji-based visual system for quick trend identification
💡 Key Features
1. Performance Metrics
Multiple timeframe analysis (1W, 1M, 3M, 6M)
Month-over-month change tracking
Relative strength vs benchmark index
2. Advanced Analytics
Momentum Score: Weighted composite of recent performance
Acceleration: Rate of change in momentum (second derivative)
Money Flow Signals: IN/OUT/TURN/WATCH indicators
3. Strategy Preset Filters
🎯 Swing Trade: High momentum opportunities
📈 Trend Follow: Established uptrends
🔄 Mean Reversion: Oversold bounce candidates
💎 Value Hunt: Deep value opportunities
🚀 Breakout: Emerging strength
⚠️ Risk Off: Sectors to avoid
4. Customization
All 39 sector ETFs can be customized
Adjustable benchmark index
Flexible display options
Multiple sorting methods
📋 Settings Documentation
Display Settings
Show Table (Default: On)
Toggles the entire dashboard display
Table Position (Default: Middle Center)
Choose from 9 positions on your chart
Options: Top/Middle/Bottom × Left/Center/Right
Rows to Show (Default: 15)
Number of sectors displayed (5-40)
Useful for focusing on top/bottom performers
Sort By (Default: Momentum)
1M/3M/6M: Sort by specific timeframe performance
Momentum: Weighted recent performance score
Acceleration: Rate of momentum change
1M Change: Month-over-month improvement
RS: Relative strength vs benchmark
Flow: IN First: Prioritize sectors with inflows
Flow: TURN First: Focus on reversal candidates
Recovery Plays: Oversold sectors recovering
Oversold Bounce: Deepest declines with positive signs
Top Gainers/Losers 3M: Best/worst quarterly performers
Best Acc + Mom: Combined strength score
Worst Acc (Topping): Sectors losing momentum
Filter Settings
Strategy Preset Filter (Default: All)
All: No filtering
🎯 Swing Trade: Mom >5, Acc >2, Money flowing in
📈 Trend Follow: Positive 1M & 3M, RS >0
🔄 Mean Reversion: Oversold but improving
💎 Value Hunt: Down >10% with recovery signs
🚀 Breakout: Rapid momentum surge
⚠️ Risk Off: Declining or topping sectors
Custom Flow Filter: Use manual flow filter
Custom Flow Signal Filter (Default: All)
Only active when Strategy Preset = "Custom Flow Filter"
IN Only: Strong inflows
TURN Only: Reversal signals
WATCH Only: Recovery candidates
OUT Only: Outflow sectors
Active Flows Only: Any non-neutral signal
Hide Low Volume ETFs (Default: Off)
Filters out illiquid sectors (future enhancement)
Visual Settings
Show Trend Emojis (Default: On)
🚀 Breakout (Strong 1M + High Acceleration)
🔥 Hot Recovery (From -10% to positive)
💪 Steady Uptrend (All timeframes positive)
➡️ Sideways/Ranging
⚠️ Warning/Topping (Up >15%, now slowing)
📉 Falling (Negative + declining)
🔄 Bottoming (Improving from lows)
Compact Mode (Default: Off)
Removes decimals for cleaner display
Useful when showing many rows
Min Data Points Required (Default: 3)
Minimum data points needed to display a sector
Prevents showing sectors with insufficient data
Relative Strength Settings
RS Benchmark Index (Default: AMEX:SPY)
Index to compare all sectors against
Can use SPY, QQQ, IWM, or any other index
RS Period (Days) (Default: 21)
Lookback period for RS calculation
21 days = 1 month, 63 days = 3 months, etc.
Sector ETF Settings (Groups 1-39)
Each sector has two inputs:
Symbol: The ticker (e.g., "AMEX:XLF")
Name: Display name (e.g., "Financials")
All 39 sectors can be customized to track different ETFs or markets.
📈 Column Explanations
Sector: ETF name/description
1M%: 1-month (21-day) performance
3M%: 3-month (63-day) performance
6M%: 6-month (126-day) performance
Mom: Momentum score (weighted average, recent-biased)
Acc: Acceleration (momentum rate of change)
Δ1M: Month-over-month change
RS: Relative strength vs benchmark
Flow: Money flow signal
↗️ IN: Strong inflows
🔄 TURN: Potential reversal
👀 WATCH: Recovery candidate
↘️ OUT: Outflows
—: Neutral
🎮 Usage Tips
For Swing Traders (3-14 days)
Use "🎯 Swing Trade" filter
Sort by "Acceleration" or "Momentum"
Look for Flow = "IN" and Mom >10
Confirm with positive RS
For Position Traders (2-8 weeks)
Use "📈 Trend Follow" filter
Sort by "RS" or "Best Acc + Mom"
Focus on consistent green across timeframes
Ensure RS >3 for market leaders
For Value Investors
Use "💎 Value Hunt" filter
Sort by "Recovery Plays" or "Top Losers 3M"
Look for improving Δ1M
Check for "WATCH" or "TURN" signals
For Risk Management
Regularly check "⚠️ Risk Off" filter
Sort by "Worst Acc (Topping)"
Review holdings for ⚠️ warning emojis
Exit sectors showing "OUT" flow
Market Regime Recognition
Bull Market: Many sectors showing "IN" flow, positive RS
Bear Market: Widespread "OUT" flows, negative RS
Rotation: Mixed flows, some "IN" while others "OUT"
Recovery: Multiple "TURN" and "WATCH" signals
🔧 Pro Tips
Combine Filters + Sorting: Filter first to narrow candidates, then sort to prioritize
Multi-Timeframe Confirmation: Best setups show alignment across 1M, 3M, and momentum
RS is Key: Sectors outperforming SPY (RS >0) tend to continue outperforming
Acceleration Matters: Positive acceleration often precedes price breakouts
Flow Transitions: "WATCH" → "TURN" → "IN" progression identifies new trends early
Regular Scans:
Daily: Check "Acceleration" sort
Weekly: Review "1M Change"
Monthly: Analyze "RS" shifts
Divergence Signals:
Price up but Acceleration down = Potential top
Price down but Acceleration up = Potential bottom
Sector Pairs Trading: Long sectors with "IN" flow, short sectors with "OUT" flow
⚠️ Important Notes
This indicator makes 40 security requests (maximum allowed)
Best used on Daily timeframe
Data updates in real-time during market hours
Some ETFs may show "—" if data is unavailable
🎯 Common Strategies
"Follow the Flow"
Only trade sectors showing "IN" flow with positive RS
"Rotation Catcher"
Focus on "TURN" signals in sectors down >15% from highs
"Momentum Rider"
Trade top 3 sectors by Momentum score, exit when Acceleration turns negative
"Mean Reversion"
Buy sectors in bottom 20% by 3M performance when Δ1M improves
"Relative Strength Leader"
Maintain positions only in sectors with RS >5
Not financial advice - always do additional research Indicator

Indicator

Multi-Sector Trend AnalysisThis script, titled "Multi-Sector Trend Analysis: Track Sector Momentum and Trends," is designed to assist traders and investors in monitoring multiple sectors of the stock market simultaneously. It leverages technical analysis by incorporating trend detection and momentum indicators like moving averages and the Relative Strength Index (RSI) to offer insights into the price action of various market sectors.
Core Features:
1. Sector-Based Analysis: The script covers 20 major sectors from the NSE (National Stock Exchange) such as Auto, Banking, Energy, FMCG, IT, Pharma, and others. Users can customize which sectors they wish to analyze using the available input fields.
Technical Indicators: The script uses two core technical indicators to detect trends and momentum:
2. Moving Averages: The script calculates both fast and slow exponential moving averages (EMAs). These are critical for identifying short- and long-term price trends and crossovers, helping detect shifts in momentum.
3. Relative Strength Index (RSI): A well-known momentum indicator that shows whether a stock is overbought or oversold. This script uses a 14-period RSI to gauge the strength of each sector.
4. Trend Detection: The script identifies whether the current market trend is "Up" or "Down" based on the relationship between the fast and slow EMAs (i.e., whether the fast EMA is above or below the slow EMA). It highlights this trend visually in a table format, allowing quick and easy trend recognition.
5. Gain/Loss Tracking: This feature calculates the percentage gain or loss since the last EMA crossover (a key point in trend change), giving users a sense of how much the price has moved since the trend shifted.
6. Customizable Table for Display: The script displays the analyzed data in a table format, where users can view each sector's:
Symbol
Trend (Up or Down)
RSI Value
Gain/Loss Since the Last EMA Crossover
This table is customizable in terms of size and color theme (dark or light), providing flexibility in presentation for different charting styles.
How It Works:
Sector Selection: Users can input up to 20 different sector symbols for analysis.
Moving Averages: Users can define the period lengths for both the fast and slow EMAs to suit their trading strategies.
Table Options: Choose between different table sizes and opt for a dark theme to enhance the visual appearance on charts.
How to Use:
Select the symbols (sectors) that you want to track. The script includes pre-configured symbols for major sectors on the NSE, but you can modify these to suit your needs.
Adjust the fast and slow EMA lengths to your preference. A common setting would be 3 for the fast EMA and 4 for the slow EMA, but more conservative traders might opt for higher values.
Customize the table size and theme based on your preference, whether you want a compact table or a larger one for easier readability.
Why Use This Script:
This script is ideal for traders looking to:
Monitor multiple market sectors simultaneously.
Identify key trends across sectors quickly.
Understand momentum and detect potential reversals through RSI and EMA crossovers.
Stay informed on sector performance using a clear visual table that tracks gains or losses.
By using this script, traders can gain better insights into sector-based trading strategies, improve their sector rotation tactics, and stay informed about the broader market environment. It provides a powerful yet easy-to-use tool for both beginner and advanced traders.
Indicator

Sector MomentumThis indicator shows the momentum of a market sector. Under the hood, it's the MACD of the number of stocks above their 20 SMA in a specific sectors. The best insight it gives is to tell if the market is doing a sector rotation or having a full blown correction.
Users have the options to choose a specific sector out of the 11 sectors:
XLB, XLC, XLE, XLF, XLI, XLK, XLP, XLRE, XLU, XLV, XLY or show all them them by adding multiple indicators.
Use this indicator similar to MACD to look for momentum acceleration, deceleration and turn in a sector. More importantly, users can open up the indicator for all sectors and then compare between each.
Examples:
1. When we see momentum slows down in XLP and turn of XLK, it's a sign of sector rotation from consumer staple to tech. Money is going from defensive to riskier assets. Market is leaning towards risk-on mode. Stocks in tech have higher probability to outperform those in consumer staple.
2. When we see momentum subside across all sectors all at once or one by one, particularly both XLP, XLK/XLY, we'd expect market breadth is taking a hit across all sectors. This is not a sector rotation. A short to mid term market correction or drawdown is very likely.
Indicator

Indicator

Indicator

Aggregated Volume with ColorsBITSTAMP:BTCUSD
This indicator aggregates trading volume data of up to 10 symbols and can display the individual data by color.
It is useful for assets which are traded on multiple exchanges, like cryptocurrencies, commodities, forex and derivatives showing you what is happening across the market and on the individual exchanges to give you beter insights.
You can change the symbols from which the indicator gathers data in the settings under inputs, just like the colors, and you can add a moving average.
By default trading volume is aggregated from the following symbols:
Binance, BTC /USDT
Binance, BTC /BUSD
Bingbon, BTC /USD
Huobi, BTC /USDT
OkeX, BTC /USDT
Coinbase, BTC /USD
Bitfinex, BTC /USD
Gemini, BTC /USD
Kraken, XBT/USD
Bitstamp, BTC /USD
Indicator
