Using A* Search to Find Weighted Paths Through Swing Structure
Summary
The article presents a MetaTrader 5 framework that models validated swing highs and lows as nodes in a graph. It connects those nodes with weighted edges, with costs incorporating ATR-normalized distance, spread, and a noise penalty. On each new bar, an A* search looks for a low-cost route from the area near current price toward a target in the trend direction. A path is eligible for a trade only if it meets filters for directional consistency and total cost and has no opposing swing obstacle. The final node supplies the target, while an opposing swing provides a structural stop, with an ATR buffer; position size is based on a percentage of account balance.
The EA also draws nodes, edges, and its selected path for inspection. The text names an XAUUSD H1 backtest window but supplies no numerical results or detailed analysis of the outcome. Thus it explains a configurable strategy framework rather than demonstrating a validated edge. Its decisions depend on swing definitions, cost weights, and thresholds, which would need careful testing for robustness and execution conditions.
Key ideas
- The system represents unbreached swing highs and lows as nodes in a weighted price graph.
- Edge costs combine ATR-scaled distance with spread and noise penalties.
- A* searches for a route toward a trend-direction target, and path filters determine whether a trade is allowed.
- The target and stop are tied to graph structure, with an ATR buffer and percentage-based position sizing.
- The article describes a backtest setup but provides no numerical results to establish the framework's profitability.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.