200 Week Moving Average Heatmap
Dec 28, 2020

The 200 Week Moving Average Heatmap indicator provides a visual representation of long-term price trends by applying a gradient color scale to a 200-week Simple Moving Average based on its percentage rate of change.
Usage
The Usage section describes how the script can be used to identify market cycles and momentum shifts. By analyzing the color transitions of the moving average, traders can gauge the velocity of price movements relative to historical long-term averages.
- Trend Identification: A blue or cool-toned moving average indicates low momentum or a consolidating market, often associated with market bottoms or accumulation phases.
- Momentum Acceleration: As the color shifts through green and yellow toward red, it signifies an increasing rate of change in the moving average.
- Cycle Peaks: Bright red colors indicate high percentage increases in the moving average value, which historically often correlate with overheating markets or cycle peaks.
- Crossover Alerts: The tool includes built-in alerts for when the price crosses above or below the moving average line, assisting in identifying potential support or resistance flips.
Details
The script calculates a Simple Moving Average (SMA) with a default lookback period optimized for weekly data (typically 1400 days for a 200-week average). It uses request.security to ensure the calculation remains consistent across different timeframes.
The core logic focuses on the delta percentage (rate of change) between the current moving average value and the previous value. This delta is then scaled using a multiplier and mapped to a 200-color array. The gradient flows from blue (0% or negative growth) to green (moderate growth) and finally to red (aggressive growth). This visualization technique, originally popularized for Bitcoin long-term analysis, helps distinguish between healthy growth and parabolic, unsustainable price action.
Settings
- Lookback: The number of bars used to calculate the moving average. Defaults to 1400 (which represents 200 weeks on a daily chart).
- MA Source: Determines the price data used for the calculation (e.g., Close, Open, High, Low).
FAQ
How do I interpret the colors on the 200 Week Moving Average Heatmap? Cooler colors like blue signify slow growth or stagnation, while warmer colors like orange and red indicate rapid price acceleration and potential market overheating.
Can I use this indicator on intraday timeframes? Yes, the script is designed to request daily data to maintain the integrity of the long-term moving average calculation regardless of the chart timeframe you are currently viewing.
How can I get access to the 200 Week Moving Average Heatmap? 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.