All indicators

Moving Average Colored EMA/3 SMA

May 26, 2017

Static chart image
Support and ResistanceSignalsMoving Averages

The Moving Average Colored EMA/3 SMA indicator provides a multi-layered trend analysis tool by combining one Exponential Moving Average (EMA) and three Simple Moving Averages (SMAs) with dynamic color-coding based on slope direction. This tool allows traders to visualize trend shifts across multiple timeframes or lookback periods simultaneously, utilizing color transitions to signal bullish or bearish momentum changes.

Usage

The Usage section describes how the script can be used to identify trend direction and potential reversal points. Traders can toggle each of the four moving averages independently to suit their specific strategy, whether focusing on short-term scalping or long-term trend following.

  • Trend Identification: The primary utility of the indicator is its color-coded logic. A green line indicates the moving average is sloping upwards (bullish), a red line indicates it is sloping downwards (bearish), and a blue line indicates a neutral or flat slope.
  • Confluence Trading: By enabling multiple SMAs (e.g., 50, 100, and 200), users can look for "confluence" where all averages align in color, suggesting a strong established trend.
  • Crossover & Support/Resistance: The indicator can be used to identify classic moving average crossovers or to treat the colored lines as dynamic support and resistance levels.
  • Alerts: The script is optimized with alerts that trigger when any of the active moving averages change direction, providing real-time notifications for potential trend shifts.

Details

The Moving Average Colored EMA/3 SMA calculates its values based on the closing price of the current bar. The core logic involves comparing the current moving average value to the value of the previous bar ($n > n[1]$).

The tool includes:

  1. Exponential Moving Average (EMA): Reacts faster to recent price changes, typically used for short-term trend detection.
  2. Simple Moving Averages (SMA): Three independent SMA plots that provide a smoother, lag-sensitive view of price action over longer periods.
  3. Directional Coloring: The visual output is determined by a conditional statement that checks for an increase (green), decrease (red), or no change (blue) in value.

This refactored version by the LuxAlgo Quant Agent (based on original work by @Patrick246) ensures optimized performance and visual clarity on the chart.

Settings

  • Show EMA on chart: Toggles the visibility of the Exponential Moving Average.
  • ema Length: Sets the lookback period for the EMA calculation (Default: 15).
  • Show SMA on chart: Toggles the visibility of the first Simple Moving Average.
  • sma Length: Sets the lookback period for the first SMA calculation (Default: 50).
  • Show SMA2 on chart: Toggles the visibility of the second Simple Moving Average.
  • sma2 Length: Sets the lookback period for the second SMA calculation (Default: 100).
  • Show SMA3 on chart: Toggles the visibility of the third Simple Moving Average.
  • sma3 Length: Sets the lookback period for the third SMA calculation (Default: 200).

FAQ

How do I interpret the color changes on the lines? A green line signifies the moving average is rising, indicating bullish momentum. A red line signifies the average is falling, indicating bearish momentum. A blue line indicates the value is unchanged from the previous bar.

Can I use this indicator for intraday trading? Yes, the indicator is versatile and can be applied to any timeframe. By adjusting the lengths of the EMA and SMAs, you can tailor the sensitivity to intraday price action or long-term swings.

How do I access the Moving Average Colored EMA/3 SMA? 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.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.