Triangular Moving Average Slope Indicator V1
Jan 28, 2015

The Triangular Moving Average Slope Indicator V1 tool tracks the rate of change of a Triangular Moving Average (TMA) to identify momentum shifts and trend direction across multiple timeframes.
Usage
The Usage section describes how the script can be used to interpret market momentum. Users can monitor the histogram columns to determine the current trend strength; rising columns typically indicate increasing bullish momentum, while falling columns suggest bearish momentum or exhaustion.
Directional Signals
The indicator changes color based on the slope's movement relative to its previous value. A green column indicates the slope is increasing, whereas a red column indicates the slope is decreasing. Traders can use these transitions to identify potential early trend reversals or trend continuations.
Multi-Timeframe Analysis
By enabling the alternative timeframe settings, the script plots circles on the right side of the chart representing the TMA slope of higher timeframes (e.g., Daily, Weekly, Monthly). This allows users to confirm local momentum against a broader market context without switching charts.
Details
The script calculates the Triangular Moving Average (TMA) by applying a Simple Moving Average (SMA) to a previously smoothed SMA of the source data. In this implementation, the source data is pre-processed using a Symmetrically Weighted Moving Average (swma), which applies weights of [1/6, 2/6, 2/6, 1/6] to the last four bars.
The slope is derived from the ta.change of the TMA value. This double-smoothing process results in a lag-heavy but extremely smooth oscillator that filters out minor price noise, making the underlying trend direction more apparent. The multi-timeframe functionality utilizes the request.security function with barmerge.lookahead_on to provide context for higher-period trends.
Settings
Main Settings
- Length: Determines the window size for the two SMA calculations used to create the TMA. Higher values result in a smoother but more lagging slope.
- Display Alternative Timeframe?: Toggles the visibility of the multi-timeframe circles on the right side of the chart.
Timeframe Settings
- Alternative Timeframe 1: Sets the first higher timeframe for comparison (default is Daily).
- Alternative Timeframe 2: Sets the second higher timeframe for comparison (default is Weekly).
- Alternative Timeframe 3: Sets the third higher timeframe for comparison (default is Monthly).
FAQ
How do I interpret the color changes in the histogram?
A green column appears when the current TMA slope is higher than the previous bar's slope, suggesting accelerating upward momentum. A red column appears when the slope is lower than the previous bar, suggesting decelerating momentum or a downward turn.
What is the advantage of using a Triangular Moving Average over a standard SMA?
The TMA is essentially a double-smoothed SMA, which gives more weight to the middle portion of the data interval. This results in a much smoother curve that is less reactive to outliers and "whipsaws" compared to a standard Simple Moving Average.
How can I access the Triangular Moving Average Slope Indicator V1?
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.