Indicators
MACD Indicator Explained for Automated Trading
How the MACD (Moving Average Convergence Divergence) works, what the signal line and histogram tell you, and how to build a MACD strategy in Setup.Cash.
Featured image placeholder
/og/setup-cash-og.svg
MACD (Moving Average Convergence Divergence) is a trend-and-momentum indicator built from moving averages. It is popular because it captures both direction and momentum in one tool.
The Three Components
- MACD line = fast EMA − slow EMA (default 12 and 26). Measures momentum.
- Signal line = EMA of the MACD line (default 9). Smooths it.
- Histogram = MACD line − signal line. Shows momentum building or fading.
How to Read It
- Bullish cross: MACD line crosses above the signal line — momentum turning up.
- Bearish cross: MACD line crosses below the signal line — momentum turning down.
- Zero line: MACD above zero is broadly bullish; below zero, bearish.
- Histogram: growing bars mean accelerating momentum; shrinking bars mean it is fading.
A MACD Strategy in Setup.Cash
The classic setup is the signal-line crossover:
- Long when MACD crosses above signal (ideally with MACD above zero).
- Short when MACD crosses below signal (ideally below zero).
Add the MACD indicator in the builder, set a condition on the cross, and pair it with a stop and target. Or describe it to text-to-strategy: "MACD bullish cross on the Nasdaq 1h with ATR stop and 2R target."
Strengths and Weaknesses
- Strength: captures trend changes and momentum shifts well in trending markets.
- Weakness: whipsaws in choppy, sideways markets — crossovers fire repeatedly with no follow-through.
To reduce whipsaws, combine MACD with a higher-timeframe trend filter so you only take crosses in the direction of the bigger trend.
Tuning MACD
- Faster settings (e.g., 8/17/9): more responsive, more signals.
- Slower settings (e.g., 19/39/9): smoother, fewer but cleaner signals.
Test changes in a backtest — faster is not always better.
Build a Custom MACD
Want a MACD variant — say, a histogram-only momentum trigger, or MACD on a custom source? Build it in the Indicators Lab with the formula language, or generate it with AI.
MACD is a solid momentum tool, but like any indicator it describes the past. Confirm any MACD strategy with backtesting and paper trading before risking capital.
Related Posts
View allIndicators
Ichimoku Cloud Explained for Automated Trading
Understand the five Ichimoku lines, how the cloud (Kumo) defines trend and support/resistance, and how to automate Ichimoku signals in Setup.Cash.
2 min read · 381 words
Indicators
Moving Averages Explained: SMA, EMA, WMA, RMA
How simple, exponential, weighted, and smoothed moving averages differ, when to use each, and how to build a moving-average strategy in Setup.Cash.
2 min read · 401 words
Indicators
Supertrend Indicator Explained: A Trend-Following Trailing Stop
How the Supertrend indicator uses ATR to flip between bullish and bearish, why it doubles as a trailing stop, and how to automate it in Setup.Cash.
2 min read · 382 words
Indicators
ADX and DI Explained: Measuring Trend Strength
How the Average Directional Index measures trend strength, how +DI and −DI show direction, and how to use ADX as a regime filter in Setup.Cash.
2 min read · 291 words
Start here
Build your trading bot workflow with structure
Use Setup.Cash to create, backtest, and paper trade rule-based strategies without relying on guesswork. Not financial advice. Trading involves risk.