RSI Divergence Entries with an EMA Trend Filter and ATR Exits
Summary
The available script describes a divergence strategy that compares successive price pivots with RSI values at those pivots. Bullish divergence occurs when price makes a lower pivot low while RSI makes a higher low; bearish divergence uses a higher price high with a lower RSI high. An optional EMA filter accepts long signals above the trend EMA and short signals below it. The listed defaults include a 14-period RSI, five bars on each side for pivot detection, and a 200-period EMA.
Risk controls are configurable: the inputs include ATR-based stop distance, a risk/reward target, and a trailing ATR stop. The excerpt ends during the entry logic, so the complete order and exit implementation cannot be confirmed from the supplied text. It includes commission and slippage assumptions in the strategy configuration, but provides no backtest period, market, or performance results. Pivot-based signals are only recognized after the right-side bars have formed, which can delay confirmation; the document offers no analysis of that tradeoff or evidence that the filters improve results.
Key ideas
- Bullish divergence compares a lower price pivot low with a higher RSI low, while bearish divergence compares a higher price pivot high with a lower RSI high.
- An optional long-term EMA filter restricts signals according to whether price is above or below the average.
- Pivot settings determine how many bars are required to confirm local highs and lows.
- The inputs allow ATR-based stops, a risk/reward target, and a trailing stop.
- The source excerpt is incomplete and includes no backtest results, so strategy performance cannot be assessed from the document.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.