Skip to content
All library documents

Detecting Classic and Reverse Divergence with Stochastic

Article MQL5 code base

Summary

This indicator identifies divergence between price and a standard Stochastic oscillator. It draws classic divergence with a solid line and reverse divergence with a dotted line, providing a visual way to compare price swings with oscillator behavior. Alerts and message language can also be configured when divergence is detected.

A standard Stochastic does not need to be displayed on the chart for divergence lines to appear there. If one is attached, the indicator also draws lines in its window and adopts that oscillator’s settings. Users can adjust bullish and bearish line colors and choose the message output mode. The description provides no performance evidence or rules for trading the detected patterns, so it explains visualization and configuration rather than validating a standalone strategy.

Key ideas

  • The indicator compares price behavior with a standard Stochastic to identify divergence.
  • Classic divergence is drawn with solid lines, while reverse divergence uses dotted lines.
  • A separate Stochastic chart display is optional, but attaching one makes the indicator use its settings.
  • Users can configure line colors, alert output, and message language.

Tags

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