
The momentum classic — Moving Average Convergence Divergence in its purest form. Two modes: signal-line cross or histogram flip.
MACD (Moving Average Convergence Divergence) was built by Gerald Appel in the late 1970s and is one of the most-watched momentum indicators on TradingView. It builds on three EMA-based components:
Default parameters are the textbook 12/26/9 — fast EMA over 12 candles, slow EMA over 26, signal smoothing 9.
Two trade modes:
MACD lags by construction (it's all EMAs) but it captures momentum shifts cleaner than raw price action. Famous for catching divergences (price makes a new high but MACD doesn't), though that pattern isn't part of the basic strategy here.
| Name | Default | Range | Description |
|---|---|---|---|
| Fast EMA Period | 12 | 2–100 | Fast EMA component of the MACD line. Default 12 — textbook Appel value. |
| Slow EMA Period | 26 | 2–200 | Slow EMA component of the MACD line. Default 26 — textbook Appel value. |
| Signal Period | 9 | 2–50 | EMA smoothing applied to the MACD line itself to produce the Signal line. Default 9. |
The pre-baked mini-backtest is refreshed daily — check back soon or start a live run in the Arena.
Run in Arena →// Indicators
macd = EMA(close, fast_period) − EMA(close, slow_period)
signal = EMA(macd, signal_period)
histogram = macd − signal
// Entry
if mode == 'cross':
if macd crosses_above signal and position.is_flat:
BUY
else if mode == 'histogram':
if histogram crosses_above 0 and position.is_flat:
BUY
// Exit
if mode == 'cross':
if macd crosses_below signal and position.is_long:
SELL
else if mode == 'histogram':
if histogram crosses_below 0 and position.is_long:
SELL**Cross** for faster reaction, more trades, better entry timing in strong trends. **Histogram** for fewer false signals, slower entries that wait for momentum to actually flip. On crypto 1D backtests, histogram tends to have fewer trades but slightly better win rate. On weekly timeframes, the gap usually shrinks — both modes converge. Try both with the same other params and compare the backtests directly.
Gerald Appel chose 12 and 26 in the 1970s because they corresponded to roughly half (12 days) and a full (26 trading days) lunar month — meaningful for stock-market cycles back then. 9 for the signal was empirical. They're now industry standard so everyone watching MACD sees the same values, making the indicator self-reinforcing. You can absolutely change them — try 5/35/5 for faster intraday reaction or 19/39/9 for swing-position trading on weekly charts.
OBV-MACD applies the same MACD formula but to On-Balance Volume instead of price. OBV is a cumulative volume metric (adds volume on up-days, subtracts on down-days), so OBV-MACD captures momentum in **money flow**, not price. They often agree but can diverge — when price keeps making new highs but OBV-MACD flattens, that's a classic volume-divergence warning. Plain MACD here works purely on close prices.
Apply MACD logic to On-Balance Volume — combining volume confirmation with trend signals. Volume tells you the truth that price hides.
The configurable trend-switcher — two exponential moving averages cross, and the trade direction flips. Faster than Golden Cross, simpler than EMA Trend Bias.
Two EMAs plus an ATR-based neutral zone — like the commercial Larsson Line, but tunable, transparent, and backtested. Choose your bias.
Check out our Strategy Insights Reports — pre-baked deep-dives with historical results, comparisons, and market context.