MACD has been a staple of technical analysis since Gerald Appel developed it in the 1970s. In crypto markets, it remains remarkably effective at identifying trend shifts on 1h and 4h timeframes.
**MACD Line** — the difference between 12-period and 26-period EMAs.
**Signal Line** — a 9-period EMA of the MACD Line. When MACD crosses above signal, bullish.
**Histogram** — the difference between MACD and Signal. Growing positive histogram means strengthening momentum.
def macd_signal(df, fast=12, slow=26, signal=9):
ema_fast = df['close'].ewm(span=fast).mean()
ema_slow = df['close'].ewm(span=slow).mean()
macd_line = ema_fast - ema_slow
signal_line = macd_line.ewm(span=signal).mean()
cross_up = (macd_line > signal_line) & (macd_line.shift() <= signal_line.shift())
cross_down = (macd_line < signal_line) & (macd_line.shift() >= signal_line.shift())
return cross_up, cross_down
Only take bullish crossovers when MACD is above zero, and bearish crossovers when below zero. This single filter eliminates the majority of whipsaw signals in ranging markets.
Q: What MACD settings work best for BTC and ETH perpetuals on LMEX?
The standard (12, 26, 9) settings work well on 4h and daily charts. For 1h trading, try (8, 21, 5) for faster signals. Always backtest parameter changes on LMEX historical data before deploying live.
Q: How do I filter false MACD signals in sideways crypto markets?
Use the zero line filter — only take bullish crossovers when the MACD line is above zero, and bearish crossovers when below zero. Adding a volume filter (only trade when volume is above the 20-period average) further reduces noise.
Q: Can MACD be used for scalping on LMEX 5-minute charts?
MACD generates too many false signals on very short timeframes. For scalping on 5m charts, VWAP deviation or order flow imbalance indicators are more suitable. MACD is most reliable on 1h timeframes and above.
Q: How does MACD histogram divergence work as a trading signal?
When price makes a new high but the MACD histogram makes a lower high, bearish divergence signals weakening momentum. This often precedes a reversal. Divergence is most reliable at key support and resistance levels.