Skip to content
All library documents

Using Breadth-First Search to Score Swing Market Structure

Article MQL5 articles

Summary

The article describes an MQL5 Expert Advisor that represents detected swing highs and lows as nodes in a time-ordered graph. Directed links connect swings chronologically, and breadth-first search processes the structure in levels from a historical anchor. Each swing receives a bullish or bearish classification; the system weights more recent structures more heavily to produce a bias score from -1 to +1. Configurable history modes, swing sensitivity and bias thresholds control the analysis, while optional breakout confirmation, trade settings and chart drawings connect the score to execution and review.

The document explains the intended design and lists a two-month H1 backtest period, but the supplied excerpt gives no equity curve, performance statistics or trade results. It therefore does not establish that BFS adds predictive value or that the EA is profitable. The graph representation and weighting rules also depend on implementation choices, and the article does not provide enough visible code here to assess them fully. Treat the method as a proposed way to formalize swing analysis that requires independent testing, including out-of-sample evaluation and realistic trading costs.

Key ideas

  • The system represents swing highs and lows as nodes connected in chronological order.
  • Breadth-first traversal processes the market structure level by level from a historical anchor.
  • Bullish and bearish swing classifications contribute to a bias score, with recent structures weighted more heavily.
  • Trading permissions depend on configurable bias thresholds and may include breakout confirmation.
  • The excerpt states a backtest period but supplies no performance evidence to evaluate the strategy.

Tags

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