Discussing the article: "Automating Trading Strategies in MQL5 (Part 37): Regular RSI Divergence Convergence with Visual Indicators"

 

Check out the new article: Automating Trading Strategies in MQL5 (Part 37): Regular RSI Divergence Convergence with Visual Indicators.

In this article, we build an MQL5 EA that detects regular RSI divergences using swing points with strength, bar limits, and tolerance checks. It executes trades on bullish or bearish signals with fixed lots, SL/TP in pips, and optional trailing stops. Visuals include colored lines on charts and labeled swings for better strategy insights

The regular RSI divergence convergence strategy focuses on spotting potential trend reversals by identifying mismatches between price action and the Relative Strength Index (RSI) oscillator, which measures momentum. For bullish divergence, the price forms a lower low while the RSI creates a higher low, signaling weakening bearish momentum and a likely bullish reversal. For bearish divergence, the price makes a higher high, but the RSI shows a lower high, indicating fading bullish momentum and a potential bearish shift.

We use confirmed swing points over a set number of bars to detect these patterns. To ensure a clean divergence, we apply a tolerance that avoids intermediate crossings. Entry is triggered when a bullish divergence is identified—take a long position at the close of the confirmation bar—or when a bearish divergence is spotted—enter a short position at the close of the confirmation bar. Positions are managed with risk controls, including predefined stop and profit targets, as well as dynamic trailing stops. By incorporating these elements, we capitalize on reversal setups. Have a look below at the different setups we could have.

Bullish Divergence Setup:

REGULAR BULLISH DIVERGENCE

Author: Allan Munene Mutiiria