Structure Break Retest Tracker
"Broke structure, now watch the retest" is a common piece of trading advice that is rarely actually tracked mechanically. This indicator keeps the most recently confirmed swing high and swing low (built from strict fractals, same as the rest of this catalogue's structure tools) as the two active levels. When a close breaks beyond one of them, that level is handed to a small state machine: first it waits for price to come back and touch the broken level within a tolerance; once touched, it watches for the resolving close - back through the level counts as a FAILED retest, a confirmed move away in the breakout direction counts as a HELD retest. Both outcomes redraw the watch line in colour (orange while pending, green on hold, red on fail) and fire an alert. Several independent breaks can be in flight at once, since a level that has broken keeps being watched on its own timeline even after a newer swing has formed and become the current level for the next break. A break that never gets retested within the timeout window is simply dropped rather than scored either way - "broke and kept going" is a real, common outcome and is not a failure of the level. Notes and limitations - Only one active level per side (resistance, support) is tracked for future breaks - the most recently confirmed swing of each type. This does not attempt to track every historical swing level on the chart at once, only the current one plus any of its own still-unresolved breaks. - Pips-to-price conversion honours 3/5-digit brokers via MODE_DIGITS; no distance is hardcoded per symbol. - A break that never retests within InpMaxBarsToRetest, and a retest that never resolves within InpMaxBarsToResolve, are both dropped silently rather than scored - treat the absence of a verdict as "inconclusive," not as an implicit hold or fail. - The tolerance and buffer are fixed pip distances, not ATR-scaled, so the same input values will read tighter on a low-volatility symbol and looser on a high-volatility one; adjust per instrument.
Indicator · MT4 · v1.0 · Free
About Structure Break Retest Tracker
Structure Break Retest Tracker is an indicator for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 6 settings, such as Swing bars, Retest tolerance pips and Confirm buffer pips. MQL source code included.
Files in the download: StructureBreakRetestTracker.mq4, StructureBreakRetestTracker.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Swing bars | 5 | Bars each side required to confirm a swing |
| Retest tolerance pips | 3 | Distance (pips) from the level counted as a touch |
| Confirm buffer pips | 5 | Pips price must move away to confirm hold/fail |
| Max bars to retest | 60 | Bars to wait for a retest before dropping the level |
| Max bars to resolve | 30 | Bars to wait for hold/fail once retest starts |
| Alerts | true | Alert on hold, fail and new break events |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Indicators.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the indicator from the Navigator onto a chart and adjust the settings.
Tags: Fractals · Alerts · MT4 Indicator · MQL4 Source Code