All indicators

CM MACD Custom Indicator - Multiple Time Frame - V2

Jul 28, 2021

Static chart image
SignalsOscillatorsDashboardMoving Averages

The CM MACD Custom Indicator - Multiple Time Frame - V2 indicator provides a comprehensive momentum trading toolkit that combines traditional MACD analysis with multi-timeframe (MTF) capabilities and customizable trend visualization. It allows traders to track momentum shifts across different time horizons while offering advanced filtering options for signal clarity.

Usage

The Usage section describes how the script can be used, particularly for identifying trend reversals and momentum strength. Traders can apply the indicator to a lower timeframe chart while setting the "Indicator TimeFrame" to a higher period to identify broader market trends.

Example: A trader on a 5-minute chart can set the indicator to the 1-hour timeframe. If the MACD line crosses above the signal line on the 1-hour timeframe, it may indicate a bullish regime, even if local 5-minute price action is choppy.

The indicator offers several visual modes:

  • Trend Coloring: The MACD line can change color based on whether the trend is bullish or bearish.
  • Price Bar Highlighting: Users can enable "Show Highlight Price Bars" to color the candles on the main chart according to the MACD trend.
  • Crossover Markers: Circles appear at crossover points to signal potential entry or exit points.

Details

The script is constructed using standard Moving Average Convergence Divergence logic but adds flexibility in calculation methods. Unlike standard MACD indicators that rely solely on Exponential Moving Averages (EMA), this tool allows users to choose between Simple Moving Averages (SMA) and EMAs for both the oscillator and the signal line.

The MTF logic is integrated with the platform's native timeframe functionality, ensuring that data is requested and mapped correctly from higher periods to the current chart. The histogram calculation includes a reversal detection logic that identifies when the momentum slope changes direction, providing an early warning of weakening trends.

Settings

General Settings

  • Indicator TimeFrame: Determines the timeframe used for calculations (leave blank for current chart).
  • Fast Length: The period for the shorter moving average.
  • Slow Length: The period for the longer moving average.
  • Source: The price data used for calculation (e.g., Close, HL2).
  • Signal Smoothing: The period for the signal line moving average.
  • Oscillator MA Type: Selects between SMA or EMA for the MACD calculation.
  • Signal Line MA Type: Selects between SMA or EMA for the Signal Line calculation.

Show Plots?

  • Show MACD Lines: Toggles the visibility of the MACD and Signal lines.
  • MACD/Signal Width: Adjusts the thickness of the respective lines.
  • Show Histogram: Toggles the visibility of the central momentum histogram.
  • Show MACD Lines w/ Trend Color: Changes the MACD line color based on the current trend direction.
  • Show Highlight Price Bars: Colors the price bars on the chart according to the MACD trend.
  • Show BackGround on Cross: Highlights the chart background when a crossover occurs.
  • Show Circle on Cross: Displays a dot at the point of a MACD and Signal line crossover.

Color Settings

  • MACD/Signal Line Colors: Customizes the default colors for the oscillator lines.
  • Trend Up/Down: Sets the colors used for bullish and bearish trend indications.
  • Histogram Colors: Allows customization for "Grow" and "Fall" states both above and below the zero line.

Alerts

  • MACD Cross Up/Dn: Triggers an alert when the MACD crosses the signal line.
  • MACD Cross Up & > 0: Filtered alert for bullish crosses occurring specifically above the zero line.
  • MACD Cross Dn & < 0: Filtered alert for bearish crosses occurring specifically below the zero line.
  • Histogram Reversal: Triggers an alert when the histogram changes direction.

FAQ

How do I enable higher timeframe data on my current chart? You can change the "Indicator TimeFrame" setting in the inputs menu to your desired higher period (e.g., 1D, 4H) while staying on your preferred trading timeframe.

What is the difference between the "Grow" and "Fall" histogram colors? "Grow" indicates that momentum is accelerating in its current direction (e.g., histogram bars getting taller above zero), while "Fall" indicates momentum is decelerating or receding toward the zero line.

How do I get access to the CM MACD Custom 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.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

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