Break Retest Detector
- Indicators
- Version: 1.0
- Activations: 5
# Break Retest Detector - The full sequence, not just the break
*Category: Support and Resistance | Difficulty: intermediate | Window: chart window (overlaid on price) | Markets: Universal (Forex, indices, commodities, crypto, stocks) | Suggested timeframes: M15, M30, H1, H4, D1*
## Short description
> Recognises the full sequence of break, return to the level and reaction. It signals only when all three conditions occur in the correct order.
## Full description
### Overview
Breaking a level is not the moment to enter: it is the moment to start watching. The configuration that truly matters is price returning to the broken level, when old resistance should act as support. Whoever enters on the break pays the worst spread and suffers every false break; whoever waits for the retest enters at a better price and with one more confirmation. This indicator automates recognition of the full sequence: it locates a confirmed swing, verifies price broke it convincingly as measured in ATR, waits for the return to the level within a maximum number of bars, and signals only when price reacts by rejecting the retest. All three conditions must occur in the correct sequence: a break with no retest produces no signal, and neither does a retest that fails to hold.
### How the calculation works
1. Swings are located with the fractal definition, requiring InpWing confirmation bars per side.
2. A break is valid only if the close exceeds the level by at least InpBreakAtr times the ATR: marginal breaks are ignored.
3. After the break the indicator enters a waiting state and counts the bars elapsed.
4. The retest is recorded when price returns within InpRetestAtr times the ATR of the broken level.
5. The arrow appears only if, after the retest, the bar closes on the correct side of the level: the reaction that confirms the sequence.
6. The sequence expires if the retest does not arrive within InpMaxWait bars, or if price moves clearly back past the level.
### How to use it
- Enter when the arrow appears, with a stop just past the level: if the level gives way, the premise of the trade has collapsed.
- The gold line shows the level currently watched: when it is visible, the indicator is waiting for a retest.
- Raise InpMaxWait on low timeframes, where the return to the level can take more bars.
- Raise InpBreakAtr to accept only decisive breaks, reducing signals but improving their quality.
- Review the history before trading: being repaint free, past signals are exactly the real ones.
### Who it is for and on which timeframes
It targets breakout traders who have learned the hard way that entering on the break is the worst route. It works from M15 to D1. The state logic is transparent and every condition documented, so the indicator can be verified rather than taken on faith. It is also a good basis for anyone wanting to automate the strategy in an Expert Advisor, because the sequence is fully deterministic.
### Practical example of reading a signal
On GBPUSD H1 price breaks a swing high at 1.2740, closing at 1.2758, beyond the required margin. The gold line appears at 1.2740 and the indicator starts waiting. Over the next six bars price rises to 1.2790, then retraces and touches 1.2743, inside the retest tolerance. The bar closes at 1.2751, above the level: the green arrow appears below the low. The trader goes long with a stop at 1.2735, just below the level. Had the bar instead closed at 1.2728, clearly below, the sequence would have been cancelled with no signal produced.
## Input parameters
| Parameter | Default | Description |
|---|---|---|
| `InpWing` | 3 | Confirmation bars per side of a swing. It determines which levels count as significant enough to be worth breaking. |
| `InpAtrPeriod` | 30 | ATR period used to measure break, retest and arrow distance. |
| `InpBreakAtr` | 0.40 | Minimum break beyond the level, in ATR. It excludes marginal breaks that immediately fade. |
| `InpMaxWait` | 20 | Maximum bars to wait for the retest. Beyond this limit the sequence expires and the indicator returns to searching. |
| `InpRetestAtr` | 0.35 | Maximum distance from the level for a price return to count as a retest. |
| `InpArrowShift` | 0.70 | Distance of the arrows from price, in ATR. Purely cosmetic, it does not affect signals. |
## Advantages / strengths
- It recognises the full sequence instead of the break alone, which is the least reliable part of the move.
- All three conditions must occur in the correct order, eliminating most false signals.
- The gold line makes the internal state visible, so you always know what the indicator is waiting for.
- No repaint and fully deterministic logic, hence automatable.
## Limitations and warnings
- The retest does not always come: in strongly directional moves price never returns to the level and no signal is produced.
- It watches only one level at a time: if a more relevant one forms during the wait, it is ignored.
- Six parameters interact and require some experimentation before finding the right configuration.
- A successful retest does not guarantee continuation: it is one more confirmation, not a certainty.
**No repaint:** values printed on a closed bar are never modified afterwards.
**Disclaimer.** This product is a technical analysis tool, not an automated trading system, and it offers no profit guarantee whatsoever. Financial markets carry the risk of total loss of the invested capital. Past performance is not indicative of future results. Every signal must be confirmed with your own analysis, a money management plan and prior testing on a demo account. The author is not responsible for trading decisions taken on the basis of this indicator.
## Suggested tags / keywords for MQL5
`breakout`, `retest`, `support resistance`, `price action`, `arrows`, `sequence`, `no repaint`, `confirmation`
