Sector Momentum
Jun 30, 2023

The Sector Momentum indicator tracks the momentum of specific market sectors by calculating the MACD of the number of stocks trading above their 20-period Simple Moving Average (SMA) within a chosen sector. This tool provides traders with a high-level view of sector health, facilitating the identification of sector rotations and broader market corrections.
Usage
The Sector Momentum indicator is used similarly to a standard MACD but applied to breadth data rather than price. Traders can use it to identify momentum acceleration, deceleration, and trend reversals within a specific industry group.
- Sector Rotation Identification: By comparing multiple instances of the indicator (e.g., tech vs. consumer staples), users can spot money moving from defensive assets to riskier ones. For instance, if momentum slows in XLP (Staples) and accelerates in XLK (Tech), it suggests a "risk-on" environment where tech stocks are likely to outperform.
- Market Correction Warnings: If momentum subsides across all sectors simultaneously, especially in both defensive (XLP) and growth (XLK/XLY) sectors, it indicates a broad hit to market breadth. This often signals a likely short-to-mid-term market drawdown rather than a simple rotation.
- Momentum Turns: Crossovers between the MACD line and the signal line (represented by the histogram) can signal potential entry or exit points for sector-specific ETFs or constituent stocks.
Details
The indicator functions by fetching the "number of stocks above 20 SMA" data for a selected sector using the request.security function. It then applies a Moving Average Convergence Divergence (MACD) calculation to this breadth data.
The underlying logic uses specific ticker symbols to represent the breadth of the 11 major S&P 500 sectors:
- XLB (Materials), XLC (Communication), XLE (Energy), XLF (Financials), XLI (Industrials), XLK (Technology), XLP (Staples), XLRE (Real Estate), XLU (Utilities), XLV (Healthcare), and XLY (Discretionary).
By applying MACD to breadth rather than price, the indicator reveals the internal strength of a sector, showing whether a price move is supported by a broad range of stocks or just a few heavyweights.
Settings
- Sector: Select one of the 11 major sectors to analyze.
- Fast Length: The period for the shorter moving average used in the MACD calculation (default is 12).
- Slow Length: The period for the longer moving average used in the MACD calculation (default is 26).
- Signal Smoothing: The period used to smooth the MACD line to create the signal line (default is 9).
- Oscillator MA Type: Choose between SMA or EMA for the calculation of the fast and slow lengths.
- Signal Line MA Type: Choose between SMA or EMA for the smoothing of the signal line.
- Histogram Colors: Customize the colors for increasing and decreasing momentum above and below the zero line.
FAQ
How do I interpret the histogram?
The histogram shows the difference between the MACD line and the signal line. Growing green bars indicate accelerating upward momentum, while fading red bars suggest that downward momentum is slowing.
Can I view multiple sectors at once?
Yes, you can add the indicator to your chart multiple times and select a different sector in the settings for each instance to compare their relative momentum.
How can I access Sector Momentum?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.