Discussing the article: "Price Action Analysis Toolkit Development (Part 63): Automating Rising and Falling Wedge Detection in MQL5"

 

Check out the new article: Price Action Analysis Toolkit Development (Part 63): Automating Rising and Falling Wedge Detection in MQL5.

In this part of the Price Action Analysis Toolkit Development series, we develop an MQL5 indicator that automatically detects rising and falling wedge patterns in real time. The system confirms pivot structures, validates boundary convergence mathematically, prevents overlapping formations, and monitors breakout and failure conditions with precise visual feedback. Built using a clean object-oriented architecture, this implementation converts subjective wedge recognition into a structured, state-aware analytical component designed to strengthen disciplined price action analysis.

1. Price Compression and Converging Trendlines

Wedges form during phases of controlled contraction. Each successive swing remains bounded between two lines that gradually approach one another.

  • The upper boundary represents resistance pressure.
  • The lower boundary represents support pressure.

As price oscillates between these boundaries, the vertical distance between them decreases. This compression reflects a reduction in volatility and a tightening of market structure. The narrowing range is not random; it follows directional movement that progressively loses expansion strength. The convergence itself is what differentiates a wedge from a parallel channel. In a channel, boundaries remain equidistant. In a wedge, they do not.

The figure above is a rising wedge showing converging upper and lower boundaries with directional compression (higher highs and higher lows).

Author: Christian Benjamin