Skip to content
All library documents

Rule-Based Detection of External and Internal Market Structure

Article MQL5 articles

Summary

The article describes a rule-based MetaTrader 5 indicator for marking external trend structure and the first internal shift within it. It identifies swing highs and lows using separate lookback sizes: a larger one filters for major external turns, while a smaller one captures shorter-term movement. After refining and validating the external boundaries, the indicator searches within that range for an internal high-low sequence and a break or change of character. It then draws structure labels and lines, an entry marker, a stop based on the internal low, and a target set at a stated multiple of risk.

The implementation is presented as a staged MQL5 project, with attention to requiring sufficient history, processing once per new bar, and checking that the external structure remains valid before plotting a setup. The document explains the logic and intended chart outputs, but the supplied text gives no backtest, trade statistics, or evidence that the setup is profitable. Swing definitions depend on chosen lookbacks, and the method is educational rather than a validated trading system.

Key ideas

  • Swing highs and lows are detected by comparing candidate bars with neighboring bars over a chosen lookback.
  • A longer lookback defines external structure, while a shorter lookback identifies internal movements.
  • The indicator searches for an internal break or change of character only after validating the broader structure.
  • Trade levels are derived from the detected setup, with the stop at the internal low and a projected target based on risk.
  • The article provides implementation logic but no performance evidence for the resulting trade signals.

Tags

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