Discussing the article: "Building a Future Swing Projection Indicator in MQL5"

 

Check out the new article: Building a Future Swing Projection Indicator in MQL5.

We implement a Future Swing Projection indicator in MQL5 that analyzes historical swing structure and estimates the next move from recent price behavior. It locates six alternating swing points, measures five completed legs, and uses their average distance to project a target five bars ahead. The indicator draws swing legs, a projection line, ATR‑based support and resistance zones, and a label with the projected price to keep the process rule‑based and reproducible.

Traders using MetaTrader 5 often analyze previous price swings manually to estimate how far the next swing may extend. This process is subjective, time-consuming, and difficult to reproduce because swing identification, measurement rules, and projection methods are not clearly defined. To solve this problem, we developed a rule-based MQL5 indicator that automatically formalizes swing detection, swing measurement, and future movement projection using consistent algorithmic rules.

The indicator:

  • Recalculates once for each newly completed bar;
  • Identifies swing highs and swing lows using a customizable Swing Detection Length and confirmation from the following candle;
  • Determines the current market structure direction from the latest confirmed pivot and applies different projection logic for bullish and bearish conditions;
  • Identifies the latest sequence of six alternating swing points (three highs and three lows, or vice versa), creating five completed swing legs for analysis;
  • Measures the five completed swing movements, calculates the average swing size, and applies this value to the latest confirmed swing to estimate the potential next move;
  • Draws historical structure lines, a dotted projection line for a user-defined number of bars ahead, ATR-scaled support and resistance zones around key levels, and a label displaying the projected price level.

"Building a Future Swing Projection Indicator in MQL5"


    Author: ALGOYIN LTD