Skip to content
All library documents

Detecting Regular and Hidden RSI Divergence with Swing Points

Article MQL5 articles

Summary

The article describes an Expert Advisor that scans recent price and RSI data for regular and hidden divergences. It collects indicator values and price highs and lows, identifies local swing points, then compares successive swings. Regular bullish divergence pairs a lower price low with a higher RSI low; regular bearish divergence pairs a higher price high with a lower RSI high. Hidden divergence reverses those relationships and is treated as a possible continuation signal. Detected signals are marked on the chart and recorded for review.

The tool exposes settings for RSI period, swing confirmation, lookback, minimum price and RSI differences, and optional RSI threshold filtering. Signals are evaluated around closed bars, but the article presents divergence as a clue to potential momentum change or continuation, not a guarantee. It does not provide performance statistics or establish that the signals are profitable. The system is a visual analysis aid whose results require independent validation and testing.

Key ideas

  • Regular bullish divergence compares a lower price low with a higher RSI low and is treated as a possible reversal clue.
  • Regular bearish divergence compares a higher price high with a lower RSI high.
  • Hidden bullish and bearish divergence are presented as potential trend continuation signals.
  • The Expert Advisor finds local swings, compares corresponding price and RSI extrema, then draws and logs signals.
  • Configurable swing, lookback, difference, and threshold settings affect which divergences qualify.

Tags

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