Skip to content
All library documents

MACD Crossovers with EMA Trend Confirmation and SMA Exits

Article TradingView scripts

Summary

This strategy combines MACD crossovers with an 18-period exponential moving average (EMA) to time directional entries. It opens a long position when MACD crosses above its signal line while price closes above the EMA, and a short when MACD crosses below while price closes below it. The script allows only one open position at a time.

Exit rules use both price levels and momentum: longs close below the 10-period simple moving average (SMA) of lows or on a bearish MACD crossover; shorts close above the SMA of highs or on a bullish crossover. The document provides the rules and source logic but no backtest results or measured performance. It characterizes the approach as suited to trending conditions and warns that sideways markets may produce false signals. It also recommends position sizing, avoiding excessive leverage, and backtesting before live use; the described rules alone do not establish profitability or specify transaction costs.

Key ideas

  • A long entry requires a bullish MACD crossover and a close above the 18-period EMA.
  • A short entry requires a bearish MACD crossover and a close below the 18-period EMA.
  • The strategy restricts itself to one open position at a time.
  • Long and short exits combine a 10-period SMA price condition with an opposing MACD crossover.
  • The document gives no performance results and cautions that sideways markets may generate false signals.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.