Triple Moving Averages (Gradient, Alarm & Multi TF)
Nov 30, 2023

The Triple Moving Averages indicator provides a comprehensive trend identification system by plotting three distinct moving averages with multi-timeframe support, gradient visual cues, and a specialized alert delay mechanism.
Usage
The Triple Moving Averages tool is primarily used to identify market trends and momentum shifts through the interaction of three different moving averages: Short, Key, and Long. Traders can utilize this script to visualize trend strength via gradient coloring, where the space between moving averages changes color based on the distance and relationship between the lines.
Trend Identification and Forecasting The script includes a forecasting feature that projects the moving average paths forward by calculating values with reduced periods. This helps traders anticipate potential crossovers before they occur. For example, if the Short MA forecast begins to converge with the Key MA, it suggests a potential trend shift in the coming bars.
Alert Delay System A unique feature of this tool is the "Alert Delay" system. This allows users to receive crossover alerts slightly before a bar closes, reducing the lag associated with waiting for a confirmed close while filtering out false signals that occur immediately after a bar opens. Users can set a specific time threshold (seconds, minutes, or hours) before the bar close to trigger these notifications.
Details
The script integrates several technical concepts to enhance standard moving average analysis:
- MA Selection: Supports seven different types, including Simple (SMA), Exponential (EMA), Weighted (WMA), Running (RMA), Hull (HMA), Double Exponential (DEMA), and Triple Exponential (TEMA).
- Gradient Framework: Uses a dynamic gradient calculation based on the positioning of a source MA relative to a center MA. As the source moves further from the center over several bars, the color intensity increases, signaling a strengthening trend.
- Forecasting Logic: The forecasting plots are generated by calculating the MA values for 1, 3, and 5 bars ahead using a reduced period length, which is then offset to the right of the current price action.
- Alert Optimization: The alert logic checks the remaining time in the current bar's duration against the user-defined limit to ensure alerts are only dispatched within the desired window before the bar closes.
Settings
Trend
- MA Type: Selects the calculation method for all three moving averages (SMA, EMA, WMA, RMA, HMA, DEMA, TEMA).
- Short MA: Sets the period for the fastest moving average and toggles its visibility.
- Key MA: Sets the period for the medium-term moving average and toggles its visibility.
- Long MA: Sets the period for the slowest moving average and toggles its visibility.
- Show Forecasts: Toggles the visibility of the projected moving average points.
Colors
- FILL - Bear: Sets the color for bearish trend gradients.
- Bull: Sets the color for bullish trend gradients.
- Neutral: Sets the base color for neutral or transition zones.
- Transp Key / Long: Adjusts the transparency for the fill between different MA pairs.
- Fill KeyMA / Fill LongMA: Toggles the background fills between the Short/Key and Key/Long moving averages.
Alert
- Time til bar close: The numeric threshold used to determine when an alert is allowed to trigger before a bar ends.
- Sec / Min / Hour: Selects the time unit for the "Time til bar close" setting.
FAQ
How can I see potential crossovers before they happen? Enable the "Show Forecasts" setting in the inputs. This will display small circles ahead of the current price action, representing where the moving averages are likely to head based on current momentum.
What is the benefit of the Alert Delay system? It allows you to get notified of a crossover just before the bar closes (e.g., 15 minutes before a 1-hour candle ends). This helps you prepare for a trade without the "noise" of crossovers that happen early in a bar's life and subsequently disappear.
How do I access this 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.