Johnny's Machine Learning Moving Average (MLMA) w/ Trend Alerts

Jan 30, 2025

Static chart image
Dynamic Overlays
Support and Resistance
Signals
Dashboard
Moving Averages
Volatility

The Johnny's Machine Learning Moving Average (MLMA) w/ Trend Alerts indicator provides an adaptive trend-following solution that dynamically adjusts to market volatility while integrating multiple momentum and strength filters. It utilizes ATR-based windowing and cross-indicator confirmation from ADX and RSI to filter market noise and identify high-probability trend reversals.

Usage

The Usage section describes how the script can be used to identify market sentiment and potential entry or exit points.

Trend Identification and Reversals

The MLMA changes color based on the current trend state. A green line indicates a bullish environment, while a red line suggests bearish conditions. The script also plots triangle markers to signal trend reversals:

  • Bullish Reversal (Green Up Triangle): Occurs when price crosses above the lower band while the ADX confirms trend strength and RSI indicates positive momentum.
  • Bearish Reversal (Red Down Triangle): Occurs when price crosses below the upper band under strong ADX and negative RSI conditions.

Strength and Volatility Filtering

The indicator uses ADX to filter out "weak" trends. Signals and vivid gradient fills only appear prominently when the ADX is above 25, signifying a trending market. The ATR-based adaptive windowing ensures that during high volatility, the moving average becomes more stable (longer window), whereas during low volatility, it becomes more responsive (shorter window).

Dashboard Overlay

A real-time table is provided on the chart to monitor the specific values of ADX, RSI, and the current Trend State (Bullish, Bearish, or Neutral), allowing for quick data-driven decisions without cluttering the price action.

Details

The MLMA is constructed using a "machine learning-inspired" adaptive logic. Instead of a static lookback period, it calculates a dynamic window based on the Average True Range (ATR).

The core calculation allows users to choose between four different moving average types:

  • EMA (Exponential): Prioritizes recent price action for faster response.
  • HMA (Hull): Designed to reduce lag while maintaining smoothness.
  • WMA (Weighted): Linear weighting to emphasize recent data points.
  • VWAP (Volume Weighted): Incorporates volume data to find the average price based on traded size.

The indicator further employs an envelope system (Upper and Lower Bounds) calculated using a Mean Absolute Error (MAE) multiplier, acting as dynamic support and resistance levels similar to Bollinger Bands.

Settings

General Settings

  • Moving Average Type: Selects the base calculation method (EMA, HMA, WMA, or VWAP).
  • Window Length: Sets the base lookback period for the moving average calculations.
  • ATR Multiplier for Adaptive Window: Adjusts how much market volatility (ATR) influences the contraction or expansion of the moving average window.
  • Multiplicative Factor: Determines the width of the upper and lower trend bands relative to the MLMA.
  • Source: Defines the price data used for the calculations (default is Close).

FAQ

How do I interpret the gradient fills on the chart? The intensity of the color fill between the bands represents trend strength. A more vivid color indicates a higher ADX value (stronger trend), while a faded color suggests a weakening trend or consolidation.

Can this indicator be used for scalping or long-term investing? Yes, the MLMA is designed to be asset and timeframe agnostic. The ATR-based adaptive windowing allows it to adjust its sensitivity whether you are looking at a 1-minute chart or a weekly chart.

How do I get access to Johnny's Machine Learning Moving Average (MLMA)? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free access on the following platforms
tradingviewSymbolTradingView
ninjatraderNinjaTrader
metatrader4MetaTrader 4/5
thinkorswimThinkorswim

Unlock Unlimited Access to the LuxAlgo Library

Upgrade your plan to get all indicators, strategies, charts, and full access to Quant, our AI agent.

Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.

Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.

Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.

As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.

Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.

Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.

This does not represent our full Disclaimer. Please read our full disclaimer.

© 2026 LuxAlgo Global, LLC.