Breakout And Retest Scanner V1 18 Indicator: Three Stages

Written by Dominic Walsh · Published · Last updated

The breakout and retest scanner v1 18 indicator refuses to buy the break. It runs a three-stage machine instead. Stage one finds a fractal level. A close beyond that level arms stage two. Only when price returns and holds does the third stage print an arrow.

This build ships as a compiled .ex4 for MT4 and .ex5 for MT5; the screenshots below come from EURUSD H1.

Platforms MT4 (.ex4) + MT5 (.ex5)
Chart window Main price chart
Plots 3: Broken level, Retest Buy, Retest Sell
Alerts popup, push notification, email, sound
Inputs 20

What the Breakout And Retest Scanner V1 18 Indicator draws on the chart

Broken level is the gold line carrying the frozen price the machine is watching.

Retest Buy places a deep sky blue arrow when price comes back and holds above.

Retest Sell places a red arrow for the mirror case below.

OBJ_LABEL and OBJ_TEXT build a corner panel naming the live state.

  • Broken level: line, gold, width 2
  • Retest Buy: arrow, deep sky blue, width 3, arrow code 233
  • Retest Sell: arrow, red, width 3, arrow code 234
Breakout and retest scanner v1 18 indicator on EURUSD H1 with the frozen level and retest arrows
Breakout and retest scanner v1 18 indicator on EURUSD H1 with the frozen level and retest arrows

How the Breakout And Retest Scanner V1 18 Indicator calculates its values

Stage one, confirming a level

A pivot bar must be the extreme of a window with `InpPivotBars` `5` bars on both sides. The walk runs oldest to newest, so the freshest confirmed pivot becomes the active level. A pivot cannot count until its right-hand side has printed.

Stage two, arming on a close

The machine arms only when a bar closes beyond that level by `InpBreakPts` `10` points. A wick through it does nothing. The code then freezes the level, draws it as a ray and tracks it in LevelBuf so the pending zone stays visible.

Stage three, waiting for the retest

A bullish arrow needs the bar to trade down into the level within `InpTolPts` `25` points and still close above it. A close back through by `InpInvalidPts` `40` points cancels the setup. So does waiting longer than `InpMaxWait` `40` bars without a retest.

How to read the signals

The gold line is a pending level, not a signal. Nothing has fired yet.

The panel tells you which stage the machine is in and how long it has waited.

An arrow means the level was broken and then defended on a closing basis.

A vanished gold line means the setup was cancelled or expired.

Alert channels in this build: popup, push notification, email and sound, one message per closed bar.

`EnableAlerts` ships on and `EnablePopup` carries the message. `EnablePushNotify`, `EnableEmail` and `EnableSound` stay off by default. `SoundFile` names the clip. Every stage runs on closed bars, and the guard allows one message per bar.

Every Breakout And Retest Scanner V1 18 Indicator input

Core settings

Setting What it does Default
InpPivotBars Fractal half-width for swing pivots. Bars each side of a fractal pivot, default `5`. 5
InpBreakPts Close must clear the level by (points). Points the close must clear the level by, default `10`. 10
InpTolPts Retest tolerance inside the level (points). How far into the level a retest may reach, default `25` points. 25
InpInvalidPts Close back through the level cancels (points). Points beyond the level that cancel the setup, default `40`. 40
InpMaxWait Setup expires after N bars without a retest. Bars the machine waits for a retest, default `40`. 40
InpScanBars Bars of history rebuilt each new bar. Bars of history rebuilt on each new bar, default `1000`. 1000
InpExtendBars Extend the ray N bars past the last bar. Bars the ray runs past the last bar, default `6`. 6

Display settings

Setting What it does Default
InpArrowOffset Arrow offset from the wick (points). Retest arrow distance from the wick in points, default `45`. 45
InpMaxLabels Maximum BUY / SELL text labels kept. Cap on the BUY and SELL text objects kept, default `40`. 40
InpShowLevel Draw the broken level ray. Draws the broken level ray, default `true`. on
InpLevelColor Colour of the level ray, default gold. gold
InpShowPanel Show scanner state panel. Draws the scanner state panel, default `true`. on
InpPanelCorner 0=UL 1=UR 2=LL 3=LR. Panel corner, default `0` for upper left. 0
InpPanelBg Panel background colour, default black. black

Alert settings

Setting What it does Default
EnableAlerts Switches the retest alerts on as a group, default `true`. on
EnablePopup Raises the terminal dialog on a retest, default `true`. on
EnablePushNotify Sends the retest to your phone, default `false`. off
EnableEmail Mails the retest through the terminal, default `false`. off
EnableSound Plays a file when a retest prints, default `false`. off
SoundFile Name of the wav file the retest alert uses, default `alert.wav`. alert.wav
Breakout and retest scanner v1 18 indicator inputs: InpPivotBars, InpBreakPts, InpTolPts, InpMaxWait
Breakout and retest scanner v1 18 indicator inputs: InpPivotBars, InpBreakPts, InpTolPts, InpMaxWait

Settings that fit your chart

A retest needs room to develop, which rules out the fastest charts. EURUSD H1 is the reference chart. There `InpMaxWait` at `40` bars gives a setup nearly two days to complete. On M5 that window is barely three hours. On H4 a single setup can run for a week.

When the Breakout And Retest Scanner V1 18 Indicator fails

Plenty of real breakouts never come back. The machine simply expires and you miss them.

`InpPivotBars` `5` needs five bars on the right, so a level confirms late.

A retest that holds by one point still counts. The rule cannot judge how convincing it looked.

Copy the compiled Breakout And Retest Scanner V1 18 Indicator file into your MQL4/Indicators folder, and the MT5 build into MQL5/Indicators, then restart the terminal and drag it onto a chart. The step-by-step guide with screenshots is at how to install MT4 and MT5 indicators.

Background reading on the method behind the Breakout And Retest Scanner V1 18 Indicator: PnL explained on Wikipedia, Standarddeviation at Investopedia.

Download the Breakout And Retest Scanner V1 18 Indicator for MT4 and MT5

The zip holds the compiled Breakout And Retest Scanner V1 18 Indicator build for MT4 and MT5, plus a short README. Compiled files only, no source. Enter your email below and the download link arrives in your inbox.

Download this indicator free

Enter your email and the file is yours. You also get the full MT4 and MT5 library.

  • 1,380+ indicators
  • MT4 and MT5 files
  • No spam, unsubscribe any time

FAQ

What does InpBreakPts at 10 stop?

A marginal close that barely clears the level. Ten points on a five-digit pair is one pip. The bar has to close beyond the frozen price by at least that much before the machine arms, which filters out the closes that sit right on the line.

How does InpTolPts define a retest?

It sets how far into the level price may trade and still count. At `25` points the bar can dip twenty-five points past the frozen price. What matters is where it closes: above the level for a bullish setup, below it for a bearish one.

What cancels a setup before the arrow?

Two things. A close back through the level by `InpInvalidPts` `40` points cancels it outright. So does time, because the setup expires when `InpMaxWait` `40` bars pass with no retest. Either way the gold line disappears and the machine hunts a new pivot.

What does the Broken level plot show?

The frozen price the machine is watching, drawn as a gold line and extended `InpExtendBars` bars past the last candle. It appears at the break and stays until the retest fires or the setup dies. It is a pending zone, not a signal.

Are results guaranteed?

No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Breakout And Retest Scanner V1 18 Indicator as one input. Always backtest before trading live.

External references

Dominic Walsh - Forex trader and MT4/MT5 developer

About the author

Written by Dominic Walsh, a Forex trader and MT4/MT5 indicator, Expert Advisor and script developer. Every tool on forexmt4systems.com is tested on live charts before release and ships with ready-to-use compiled MT4 (.ex4) and MT5 (.ex5) files. Learn more about the trader and developer behind this site.

How we build, test and correct every tool: Editorial & Testing Policy. Trading carries risk; see the disclaimer.

Leave a Comment