Building a Price Action Structure Indicator with Entries and Risk Targets
Summary
This MQL5 tutorial describes a custom indicator that identifies swing highs and lows, classifies higher highs and higher lows or lower highs and lower lows, and uses those sequences to represent bullish or bearish structure. The example detects pivots by comparing a candle with neighboring bars over a configurable lookback. It then marks premium or discount areas and a midpoint retracement level, and waits for a break of structure before drawing a signal with entry, stop, and two profit targets based on stated risk-reward multiples.
The article gives implementation examples and explains how the bullish and bearish logic mirror one another. It demonstrates a charting and signal-generation design, not a validated trading strategy: no out-of-sample performance or profitability evidence is presented. Signals depend on the chosen swing lookback and structural rules, and pivot detection requires later bars, which can affect when a swing becomes identifiable. The levels and risk-reward targets are rule-defined rather than evidence of likely price outcomes.
Key ideas
- Swing points are identified by comparing each candle with surrounding bars over a selected lookback.
- Sequences of swing highs and lows define the indicator’s bullish and bearish market structures.
- A midpoint retracement between key structure points is used for stop placement and zone marking.
- The indicator requires a break beyond a structural high or low before drawing a trade signal.
- Entry and two profit targets are charted using predefined risk-reward relationships, without performance validation.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.