EMA Crossover Signals with MACD and Slope Filters
Summary
This script describes a trend-following strategy that combines 9- and 21-period exponential moving averages with MACD confirmation. After an EMA crossover, it allows entries only within a configurable number of bars and when both EMA slope angles exceed directional thresholds. A neutral angle zone suppresses trades when both averages are relatively flat. A scalp setting reduces the required angle thresholds.
Stops use recent lows for long positions and recent highs for short positions; targets are set using a configurable risk-reward multiple. The script also plots signals, a combined slope-strength reading, and a dashboard of current values. It provides a rule set and display features, but no backtest results or evidence of performance. The slope is calculated from price change per bar and converted to an angle, so its values depend on the instrument’s price scale and chart timeframe. Execution assumptions, transaction costs, and the incomplete alert statement are not addressed.
Key ideas
- EMA 9/21 crossovers set the direction, with entries restricted to a configurable period after the cross.
- MACD line versus signal line and directional EMA slope thresholds confirm entries.
- A neutral zone blocks trades when both EMA angles are small.
- Stops use recent price extremes, while targets scale the stop distance by a risk-reward setting.
- The script supplies no performance results or transaction-cost analysis.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.