An order block only means something once a move has proved it. The non repaint order block indicator therefore works backwards: it waits for a large candle to close beyond a recent swing, then finds the last opposite candle before that move and boxes it. Nothing is drawn until the break has closed.
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 | 2: Bullish OB, Bearish OB |
| Alerts | popup, push notification, email, sound |
| Inputs | 14 |
Drawn output, plot by plot
Two marks plus zone rectangles on price.
`Bullish OB` prints lime with arrow 233.
`Bearish OB` prints red with arrow 234.
`BullOBColor` `clrDeepSkyBlue` fills demand zones.
`BearOBColor` `clrOrangeRed` fills supply zones.
`OBExtendBars` `40` carries each box forward.
- Bullish OB: arrow, lime, width 2, arrow code 233
- Bearish OB: arrow, red, width 2, arrow code 234

How each value gets built
The swing to beat
`StructureLookback` `50` bars set the recent high and low. `PivotStrength` `3` defines the turns inside that window.
The displacement
A candle must close beyond that swing with a body of at least `DisplacementATRmult` `1.2` times an `ATRPeriod` `14` range. Small breaks do not count.
The block
The code then looks back up to twelve bars for the last candle that closed the other way. That candle becomes the zone.
How to watch it
Blue boxes are demand, red boxes are supply.
Each box sits on the candle before the break.
Marks land on the breaking candle itself.
A return into a box is the setup people watch.
`ShowOBRectangles` hides boxes but keeps marks.
Everything appears only after the break closes.
Alert channels in this build: popup, push notification, email and sound, one message per closed bar.
A newly confirmed block is what gets reported. `EnableAlerts` is the master switch; the terminal popup and the speaker route playing `SoundFile` ship on, while the mobile notice and email stay off.
Every Non Repaint Order Block Indicator input
Core settings
| Setting | What it does | Default |
|---|---|---|
StructureLookback |
Swing high/low lookback (bars). Bars that set the swing to beat, `50`. | 50 |
PivotStrength |
Fractal half-width. Bars either side of a turn, `3`. | 3 |
DisplacementATRmult |
Displacement body >= ATR * mult. Body size in ranges for a valid break, `1.2`. | 1.2 |
ATRPeriod |
ATR period. Range window, `14`. | 14 |
OBExtendBars |
Rectangle right-edge extension. How far boxes run to the right, `40`. | 40 |
Display settings
| Setting | What it does | Default |
|---|---|---|
ShowOBRectangles |
Draw OB zone rectangles. Draw the zone boxes, `true`. | on |
BullOBColor |
(see inputs panel) | deep sky blue |
BearOBColor |
(see inputs panel) | orange red |
Alert settings
| Setting | What it does | Default |
|---|---|---|
EnableAlerts |
Master alert switch. Master switch for new-block news, `true`. | on |
EnablePopup |
Popup alert. Terminal popup, `true`. | on |
EnablePushNotify |
Push to mobile MT4. Mobile terminal notice, `false`. | off |
EnableEmail |
Email alert. | off |
EnableSound |
Sound alert. Speaker notice, ships on, `true`. | on |
SoundFile |
(see inputs panel) | alert.wav |

Symbols and timeframes
A break of a fifty-bar swing with a large body is uncommon, so blocks stay sparse. EURUSD H1 is the reference chart and gives a few a week. On M15 they cluster around session opens. On H4 each block reflects days of structure.
What this one cannot tell you
Price does not have to return to a block.
News candles pass the size test without real orders.
The twelve-bar search can pick a small candle.
Boxes extend forty bars even after price runs through.
Copy the compiled Non Repaint Order Block 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.
Download the Non Repaint Order Block Indicator for MT4 and MT5
The zip holds the compiled Non Repaint Order Block 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.
FAQ
What does DisplacementATRmult 1.2 require?
The breaking candle’s body must be at least 1.2 times the 14-bar average range. That keeps ordinary breaks out and leaves only moves strong enough to suggest real orders behind them.
How far back does Bullish OB search for its candle?
Up to twelve bars before the bullish break, stopping at the last down candle it finds. That candle’s range is boxed as demand, on the idea that buyers filled there before the move.
Why can a Bearish OB never move after it prints?
The zone is only drawn once the breaking candle has closed, and it sits on candles that closed earlier still. No later tick can shift or erase it.
What does StructureLookback 50 decide?
Which swing the break has to clear: the highest high or lowest low of the last fifty bars. A shorter window finds more breaks; a longer one keeps only the significant ones.
Are results guaranteed?
No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Non Repaint Order Block Indicator as one input. Always backtest before trading live.
Category: this is part of our Smart Money collection. Browse more Smart Money for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.
External references
- For background on this concept, see Block trade on Wikipedia.
- For broader market context, see the H.10 FX rates release at the Federal Reserve.
