Scripting Tutorial 6 - Triple Many Moving Averages Forecasting
Sep 24, 2019

The Triple Many Moving Averages indicator provides a customizable multi-period moving average system featuring crossover detection and directional forecasting based on user-defined market bias.
Usage
The Usage section describes how the script can be used to analyze trend dynamics and anticipate potential future price levels.
Moving Average Analysis
Users can plot up to three independent moving averages. Each MA can be configured with distinct periods and types (e.g., SMA, EMA, HMA). This allows for classic trend-following setups such as the "Golden Cross" or "Death Cross" by monitoring the interaction between short, medium, and long-term averages.
Crossover Identification
The script automatically identifies and labels instances where the moving averages intersect. When a crossover occurs, a label appears on the chart detailing exactly which periods and types crossed, facilitating quick identification of trend shifts or momentum changes.
Forecasting and Bias
The indicator extends current MA values five bars into the future. These projections are influenced by the "Forecast Bias" setting:
- Neutral: Forecasts based on current price levels.
- Bullish/Bearish: Adjusts the projected path by adding or subtracting a magnitude derived from the Average True Range (ATR), allowing traders to visualize "what-if" scenarios based on anticipated market direction.
Details
The script implements several calculation methods for its moving averages, including Simple (SMA), Exponential (EMA), Weighted (WMA), Hull (HMA), Double Exponential (DEMA), and Triple Exponential (TEMA).
The forecasting logic uses a weighted approach to estimate future MA values. By incorporating an ATR-based bias value, the script simulates future price action to calculate how the selected MA would react. This provides a visual representation of the lagging indicator's likely trajectory.
Settings
- MA Period (1, 2, 3): Sets the lookback period for each of the three moving averages.
- MA Type (1, 2, 3): Selects the calculation method (SMA, EMA, WMA, RMA, HMA, DEMA, or TEMA).
- MA Source (1, 2, 3): Determines the price data used for calculations (e.g., Close, Open, HL2).
- MA Visible (1, 2, 3): Toggles the visibility of individual moving average lines.
- Show Crosses: Enables or disables the visual labels for MA crossovers.
- Forecast Bias: Sets the directional assumption for the forecast (Neutral, Bullish, or Bearish).
- Forecast Bias Period: The lookback period used for the ATR calculation that informs the bias magnitude.
- Forecast Bias Magnitude: A multiplier for the ATR to increase or decrease the intensity of the forecast bias.
- Show Forecasts: Toggles the display of the five-bar forecasted circles.
FAQ
How does the forecast bias work? The bias adds or subtracts a specific magnitude (based on the ATR) to the current price before calculating the projected moving average values, simulating potential bullish or bearish market moves.
Which moving average types are supported? The tool supports SMA, EMA, WMA, RMA, HMA, DEMA, and TEMA, providing a wide range of smoothing options for different trading styles.
How do I get access to the Triple Many Moving Averages 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.