MACD 200 SMA indicator: qualify the crossover with ADX/ATR/MTF

A practical MACD 200 SMA indicator overlay: what it plots, how its ADX/ATR/MTF filters work, bar‑close rules, known false‑signal traps, and two trading strategies you can test today.



Last updated: September 2026

Note: The free, MIT‑licensed indicator discussed here is hosted on TakeProfit’s marketplace. We call out where competitors do the job better, and we link those claims. Indie (TakeProfit’s Python‑style indicator language) runs in a sandbox on TakeProfit and can be used to script indicators and strategies; code limits apply (see “Platform limitations” below).

The 10‑Second Utility: what you’ll see and how to read it

Stop taking every MACD crossover; start qualifying which ones align with the market trend. This overlay draws three moving averages, a trend ribbon, a five‑level backdrop, optional bar colors, and two circle markers that only appear when the full checklist is satisfied (see the indicator page).

  • Three moving averages: a fast and a slow (the same pair used to compute the MACD indicator), plus a thicker trend moving average (200 by default). You can choose the MACD MA type (simple or exponential moving average) and the trend MA type (SMA/EMA/WMA/HMA). Defaults are SMA for both.
  • A fill ribbon between the fast MA and the trend MA gives you fast‑vs‑trend alignment at a glance.
  • Background shading shows a five‑level regime: Strong/Weak Uptrend, Strong/Weak Downtrend, or Neutral. The logic uses price vs the trend MA, the trend MA’s slope, the MACD sign, and—only if you enable it—an ADX strength gate.
  • Optional bar colors reinforce the regime.
  • Markers: a bullish circle below a bar and a bearish circle above a bar. Bullish requires all of these at once: the histogram crosses above zero (a MACD–signal crossover), MACD > 0, fast MA > slow MA, close > trend MA, and any enabled gates (ADX, ATR, MTF) pass. Bearish mirrors those conditions.

Add MACD + SMA 200 Enhanced to your workspace and toggle filters to fit your trading strategies.

Under the hood: the components you control and what they actually do

  • MACD engine — two moving averages and their gap. MACD here is computed from two moving averages of price, with a selectable MA type for the entire MACD stack: macd_ma_type ∈ {SMA, EMA} (default SMA). Lengths default to 12 (fast), 26 (slow), and 9 (signal). The histogram is MACD minus its signal; a histogram zero‑cross equals a MACD–signal crossover (see MACD basics and the moving average convergence divergence definition, first mention linked as a primer, as of Sep 2026: Investopedia).
  • Trend MA — the guardrail. The thick trend line defaults to a 200‑period SMA. You can switch to EMA/WMA/HMA; responsiveness changes by type, not by logic. The 200‑period SMA is a widely watched long‑term trend line that many traders use to classify the market trend.
  • ADX filter (off by default). If you enable it, the gate passes only when ADX > adx_threshold (default 25.0, a common “trend present” convention). It measures trend strength, not direction.
  • ATR filter (off by default). If you enable it, ATR(atr_length) must be above SMA(ATR, atr_length). That is a simple moving average of ATR, not Wilder’s smoothing, so absolute values can differ from other platforms that use Wilder’s RMA.
  • MTF filter (off by default). If you enable it, the higher‑timeframe close must be above its own 200‑SMA for bulls (below for bears). You pick the timeframe with htf_tf (default 1D). Internally the script fetches the higher‑timeframe series via a second context and compares it to the aligned 200‑SMA value.

Five‑level regime logic (background and ribbon colors), exactly as coded:
– Strong Uptrend: price above trend MA AND trend MA rising AND MACD > 0 AND (ADX gate passes if you turned it on)
– Weak Uptrend: price above trend MA AND trend MA rising
– Strong Downtrend: price below trend MA AND trend MA falling AND MACD < 0 AND (ADX gate passes if you turned it on)
– Weak Downtrend: price below trend MA AND trend MA falling
– Neutral: anything else

Note on precedence: the ADX gate only affects the Strong states; Weak states ignore ADX even when enabled.

Defaults in Settings: fast_length=12, slow_length=26, signal_length=9, macd_ma_type=’SMA’; trend_length=200, trend_type=’SMA’; show_bar_color=on, show_mas=on, show_background=on; use_adx=off (adx_length=14, adx_threshold=25.0); use_atr=off (atr_length=14); use_mtf=off (htf_tf=’1D’).

Signal confirmation vs intrabar flicker: Indie evaluates on every real‑time update of the last bar; treat bullish/bearish confirmations and invalidations on bar close to avoid intrabar “previews” that can disappear by the close.

The filters: what each buys you and what it costs

  • SMA‑200 filter. Pro: you align with the long‑term trend (price vs a 200‑period moving average is a common regime read). Con: it lags by design; reversals confirm late.
  • ADX gate. Pro: you avoid many false signals in very low‑trend conditions by requiring minimum strength (often >25). Con: you skip early moves while ADX is still sub‑threshold.
  • ATR gate. Pro: you avoid ultra‑quiet sessions by requiring ATR above its own SMA; ATR is volatility only. Con: it can filter out calm, directional drifts because ATR doesn’t know direction.
  • MTF gate. Pro: you trade with a higher‑timeframe tailwind (HTF close on the “right” side of its 200‑SMA). Con: fewer, later signals; both timeframes must agree.
  • MACD MA type. Pro: EMA matches the classic MACD timing; SMA smooths further. Con: left on default SMA, your histogram crosses occur later than the exponential moving average convention.

The critical weaknesses (what you should actually expect to see)

  • SMA‑lag snapback. Trigger: sharp reversals. Symptom: price pushes through the 200‑SMA and runs while the background stays Neutral or “Weak” until the slope and MACD sign catch up; bullish/bearish markers can appear after the move begins.
  • MA whipsaw band. Trigger: price oscillates around the 200‑period SMA. Symptom: background ping‑pongs between Weak Up and Weak Down; the fast‑vs‑trend ribbon flips; unless you enable ADX, MACD signals can still fire into chop.
  • “Not‑quite‑MACD” by default. Trigger: you expect EMA(12/26/9) behavior. Symptom: histogram and signal crosses feel late because the default macd_ma_type is ‘SMA’; switch to ‘EMA’ to match the standard.
  • All extra filters ship off. Trigger: you run out‑of‑box. Symptom: initial markers are filtered only by price vs the trend MA and the MACD/MA conditions; ADX/ATR/MTF protections don’t apply until you turn them on.
  • Cross‑asset non‑comparability. Trigger: you port raw thresholds across assets. Symptom: MACD readings are in price units and ATR depends on smoothing; use relative, not absolute, reads.

Two strategies to test today (exact settings)

These are recipes you can reproduce, not performance promises. No win‑rate or P&L data is published here; backtest and forward test on your instrument and costs.

Setup 1 — Daily Index Ride with a long‑term trend filter
– Instrument/timeframe: SPY or QQQ, 1D.
– Settings (exact): macd_ma_type=’EMA’; fast_length=12; slow_length=26; signal_length=9; trend_length=200; trend_type=’SMA’; use_adx=True; adx_length=14; adx_threshold=25.0; use_atr=True; atr_length=14; use_mtf=True; htf_tf=’1W’.
– What to look for: a bullish marker only when all checklist items pass at once: histogram crosses above zero, MACD > 0, fast > slow, close > 200‑SMA, ADX > 25, ATR > SMA(ATR,14), and the weekly close > its weekly 200‑SMA.
– Invalidation: any checklist item failing on bar close. Common killers: ADX slipping back under 25 or price closing back under the 200‑SMA as the background drops from Up to Neutral/Down.
– Bias note: when using the weekly MTF gate, base decisions on the last closed weekly bar to avoid look‑ahead bias on the current, still‑forming week.

Setup 2 — 1‑Hour Crypto Momentum with HMA Trend
– Instrument/timeframe: BTCUSDT or ETHUSDT, 1H.
– Settings (exact): macd_ma_type=’EMA’; fast_length=12; slow_length=26; signal_length=9; trend_length=200; trend_type=’HMA’; use_adx=True; adx_length=14; adx_threshold=25.0; use_atr=True; atr_length=14; use_mtf=True; htf_tf=’1D’.
– What to look for: bullish markers after 1H pullbacks when the backdrop is Up and the daily MTF gate is also Up. The 200‑HMA reacts faster intraday; you’ll often see fast/slow re‑align above the trend before the histogram crosses back above zero.
– Invalidation: ADX dropping below 25, the 1H close slipping under the 200‑HMA, or the daily MTF gate flipping Down while price chops near the moving average.

Who this is not for (with concrete examples)

  • Mean‑reversion scalpers. If you fade spikes into VWAP bands or short “overbought” rips on a 5‑minute chart, a 200‑bar moving average regime will classify you as counter‑trend and suppress many of your entries.
  • Prediction‑seekers. If you try to buy exact bottoms on a bullish divergence before any crossover, this technical indicator will feel late; it confirms regime and momentum shifts, it does not forecast them.
  • Signal‑hunters who need frequency. If you require multiple trades per session, enabling ADX/ATR/MTF filters will cut your count sharply to avoid false signals.

FAQ

  • Is the 200‑period SMA a good trend filter?
    It’s a widely used long‑term trend classifier on daily charts: above often reads as uptrend, below as downtrend. It classifies; it doesn’t predict.

  • How do I interpret the MACD here (line, signal, histogram)?
    MACD = fast MA minus slow MA; the signal is an average of the MACD line; the histogram is MACD minus signal. A valid marker requires the histogram to cross zero in the regime’s direction—i.e., a MACD–signal crossover on that bar.

  • Which filter is “best” with MACD?
    They solve different problems. The 200‑period SMA constrains direction, ADX avoids very weak market trend states, ATR avoids ultra‑quiet volatility, and MTF keeps you with the higher‑TF bias. Each costs signals and can add delay.

  • What about divergences?
    This technical indicator does not compute or signal divergences. Markers are strictly rule‑based on histogram zero‑cross, MACD sign, moving average alignment, the 200‑period SMA, and optional ADX/ATR/MTF gates.

About this Indie implementation: constraints to know

  • No MACD pane is drawn. The script computes MACD internally but does not plot the MACD line, its signal line, or the histogram; you work off markers, regime, and the three on‑price moving averages.
  • The MTF gate is minimal by design: it checks only higher‑timeframe close vs its own 200‑SMA (not HTF MACD or slope).
  • The ATR gate compares ATR to an SMA of ATR of the same length; platforms using Wilder’s smoothing will print different absolute ATR values at the same length.

Platform limitations (vendor honesty)

  • Indie is a subset of Python; several language features are not supported (for example, no try/except, no nested function definitions, limited OOP).
  • Code runs server‑side in a sandbox; file and socket I/O are not allowed.
  • Scripts that load external CSV data cannot be published to the public Marketplace; they remain private to your account.

Competitor credit (where others beat us at something specific)

  • TradingView’s public library has a very large catalog of community scripts, including named MACD + 200‑SMA “crossover” and “trend filter” templates, plus one‑click sharing in a social layer (see TradingView’s public scripts, as of Sep 2026).
  • FMZ offers an ecosystem for automated execution and bot hosting; if live, multi‑venue bots are your priority, their marketplace and docs are worth exploring.
  • Python backtesting alternatives: if you prefer to use MACD and a 200‑period SMA inside code‑first research, traders often reach for QuantConnect or Backtrader to build and test strategies in Python.

Get the free, MIT‑licensed indicator on the TakeProfit marketplace (see the indicator page above), or extend it with your own rules in Indie if you need custom MACD signals or alternative moving average filters.

indicator page • MACD basics • TradingView public scripts

Keep reading