MACD + SMA 200 Strategy (by ChartArt)
Nov 30, 2015

The MACD + SMA 200 Strategy indicator provides a systematic approach to trend-following by combining momentum-based MACD signals with a long-term 200-period Simple Moving Average filter. It aims to identify high-probability entries by ensuring trade direction aligns with both short-term momentum and long-term market trends.
Usage
The Usage section describes how the script can be used to identify trend reversals and continuations. This strategy is primarily designed for daily timeframes on major indices and liquid assets like Bitcoin.
Long Entries
A long position is triggered when the following conditions are met:
- The MACD histogram crosses above zero.
- The MACD line is above the zero level.
- The fast MACD moving average is above the slow MACD moving average.
- The recent price remains above the 200-period SMA, confirming a bullish primary trend.
Short Entries
A short position is triggered when the inverse logic is applied:
- The MACD histogram crosses below zero.
- The MACD line is below the zero level.
- The fast MACD moving average is below the slow MACD moving average.
- The recent price remains below the 200-period SMA, confirming a bearish primary trend.
Risk Management
The tool includes a built-in risk filter that limits the maximum intraday equity loss to a user-defined percentage (defaulted at 50%) to protect against extreme volatility or black swan events.
Details
The script constructs its signals using three distinct moving average layers. The MACD components (default 12 and 26) capture shifts in momentum, while the 200-period SMA serves as a "trend barometer." By requiring the MACD momentum and the fast/slow averages to align with the 200 SMA, the strategy effectively filters out "fake-out" signals that occur against the prevailing long-term trend.
Visually, the indicator provides real-time feedback through color-coded elements. The background highlights specific crossover events, while the bar colors and moving average lines change dynamically based on whether the current price and MA slopes indicate bullish or bearish dominance.
Settings
- Source: Determines the price data used for all calculations (default is Close).
- MACD fast moving average: Sets the period for the shorter MACD average.
- MACD slow moving average: Sets the period for the longer MACD average.
- MACD signal line moving average: Sets the smoothing period for the MACD signal line.
- Very slow moving average: Defines the period for the long-term trend filter (default 200).
- Enable Bar Color?: Toggles the dynamic coloring of price bars based on trend alignment.
- Enable Moving Averages?: Toggles the visibility of the three moving average lines on the chart.
- Enable Background Color?: Toggles the background highlights that signal entry conditions.
- Max Intraday Loss(%): Sets the maximum allowable equity loss per day before the strategy halts.
FAQ
How do I use the signals from this strategy?
The strategy automates entry signals based on the confluence of MACD momentum and the 200 SMA trend. You can use the visual background highlights or the built-in alerts to identify when these conditions are met.
Can I change the sensitivity of the trend filter?
Yes, by adjusting the "Very slow moving average" setting, you can change the sensitivity of the long-term filter. A lower number will result in more frequent signals, while a higher number will be more selective.
How do I get access to the MACD + SMA 200 Strategy?
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.