TMA Centered Bands Indicator with alerts
Mar 21, 2022

The TMA Centered Bands Indicator tool provides a dynamic volatility envelope based on a centered Triangular Moving Average (TMA) to help traders estimate price extremes and trend direction. It visualizes a central baseline with upper and lower bands calculated using an Average True Range (ATR) offset, offering a smoothed perspective on market fluctuations.
Usage
The indicator is primarily used for identifying potential reversal zones when price interacts with the upper or lower bands.
- Trend Identification: The center line changes color based on the TMA slope (Bullish/Bearish), helping users identify the current momentum.
- Reversal Signals: The script plots upward (▲) and downward (▼) triangles when specific price action occurs near the bands, such as a candle closing back within the bands after a breakout.
- Caution Labels: When the TMA angle is particularly steep, the script can plot caution markers to warn users that a reversal signal might be counter-trend or high-risk.
Details
This script utilizes a "centered" TMA, which means the calculation looks both forward and backward to create a smoother average. Because standard Pine Script cannot look into the future, this indicator uses an offset technique. The most recent bars (the "half period") are drawn using lines that recalculate as new data arrives. This creates a "repainting" effect on the most recent portion of the chart, which is a characteristic of centered moving averages. It is best used for historical analysis and estimation rather than real-time "blind" signal execution.
Settings
Parameters
- Centered TMA half period: Determines the lookback and look-forward period for the TMA calculation.
- Price to use: Selects the price source (Close, Open, High, Low, Median, Typical, Weighted, Average).
- Average true range period: Sets the period for the ATR calculation used to offset the bands.
- Average true range multiplier: Adjusts the width of the bands relative to market volatility.
- Centered TMA angle caution: Sets the sensitivity for the caution labels based on the slope of the TMA.
Colors
- Bear/Bull: Customizes the colors for bearish and bullish trend slopes.
- Bands: Sets the color for the upper and lower envelopes.
- Caution label: Toggles the visibility of caution markers on the chart.
Alerts
- Crossing up/down: Triggers when price moves beyond the bands.
- Coming back: Triggers when price returns inside the bands after an excursion.
- On arrow up/down: Triggers specifically when a reversal triangle is plotted.
FAQ
How do I interpret the dotted lines at the end of the chart?
The dotted lines represent the "centered" portion of the calculation that is subject to change as new price data is received. These are the most current estimates of the bands.
Why do some signals disappear or move?
Because the TMA is centered, it recalculates the most recent bars to maintain smoothness. This tool is designed for estimation and trend analysis rather than static signal generation.
How can I access the TMA Centered Bands Indicator?
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.