Moving Average Crossover with Shading Signals
May 14, 2021

The Moving Average Crossover with Shading Signals indicator identifies trend-following trade opportunities by analyzing the alignment and crossovers of three distinct moving averages.
Usage
The indicator utilizes a three-tier moving average system (Fast, Slow, and Trend) to define market sentiment and entry/exit points. It provides visual cues through colored plots, background shading, and shape labels.
- Long Signals: A buy label (green triangle) appears when the Fast MA is above the Slow MA, the Slow MA is above the Trend MA, and a fresh crossover has occurred. During this phase, the Trend MA turns green and the space between the Fast and Slow MA is shaded green.
- Short Signals: A sell label (red triangle) appears when the Fast MA is below the Slow MA, the Slow MA is below the Trend MA, and a fresh crossover has occurred. During this phase, the Trend MA turns red and the space between the Fast and Slow MA is shaded red.
- Neutral/Consolidation: If the moving averages are not in perfect alignment (e.g., Fast is above Slow, but Slow is below the Trend), the shading turns yellow. This serves as a warning for potential retracements, consolidation, or trend reversals.
- Exit Signals: "X" shapes appear on the chart when the trend alignment breaks, signaling a potential time to close existing positions.
Details
The script is constructed using a combination of Simple Moving Averages (SMA) and Exponential Moving Averages (EMA) by default, though these are fully customizable. The core logic relies on "Dynamic Sources." When the dynamic source setting is enabled, the script automatically selects the "Low" price for calculations during uptrends and the "High" price during downtrends. This creates a smoother filter that reacts more intelligently to price action relative to the trend.
The indicator tracks two specific crossover events:
- The crossover between the Fast and Slow MA.
- The crossover between the Slow and Trend MA.
A signal is only triggered when the three averages are in a specific order (Fast > Slow > Trend for bullish; Fast < Slow < Trend for bearish) and a crossover event has just occurred.
Settings
Fast MA
- Fast MA Length: Sets the lookback period for the quickest moving average.
- Source: Determines the price data used for the Fast MA calculation.
- Type: Allows users to choose between EMA or SMA for the Fast MA.
- Use Dynamic Source?: When enabled, shifts the source to Low/High based on trend direction.
Slow MA
- Slow MA Length: Sets the lookback period for the medium-term moving average.
- Source: Determines the price data used for the Slow MA calculation.
- Type: Allows users to choose between EMA or SMA for the Slow MA.
- Use Dynamic Source?: When enabled, shifts the source based on the relationship to the Trend MA.
Trend MA
- Trend MA Length: Sets the lookback period for the long-term trend filter.
- Source: Determines the price data used for the Trend MA calculation.
- Type: Allows users to choose between EMA or SMA for the Trend MA.
- Use Dynamic Source?: When enabled, adjusts the Trend MA source dynamically.
FAQ
How do I interpret the yellow shading? Yellow shading indicates a "Neutral" or "Inconsistent" trend. This happens when the Fast and Slow MAs have crossed in one direction, but they remain on the "wrong" side of the long-term Trend MA, suggesting a potential trend transition or temporary retracement.
What is the difference between an Exit signal and a Reversal signal? An Exit signal (marked with an X) occurs when the perfect trend alignment is lost. A Reversal signal (Buy/Sell triangle) only occurs when all three moving averages align in the opposite direction.
How can I access the Moving Average Crossover with Shading Signals? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
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.

