Breakout Box Indicator: A Session Range, Then A Break

Written by Dominic Walsh · Published · Last updated

The breakout box indicator does read the clock, which sets it apart from most breakout tools. It tracks the high and low through the session named in `InpSession`, freezes them when the session ends, then waits. A close beyond either edge afterwards produces a mark.

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

Platforms MT4 (.ex4) + MT5 (.ex5)
Chart window Main price chart
Plots 4: Box High, Box Low, Buy Break, Sell Break
Alerts popup, push notification, email, sound
Inputs 14

What the Breakout Box Indicator draws on the chart

Box High is the dodger blue line at the session high.

Box Low is the orange red line at the session low.

An OBJ_RECTANGLE spans the frozen range, with an OBJ_TEXT label beside it.

Buy Break and Sell Break mark the close that left the box.

  • Box High: line, dodger blue, width 2
  • Box Low: line, orange red, width 2
  • Buy Break: arrow, lime, width 3, arrow code 233
  • Sell Break: arrow, red, width 3, arrow code 234
Breakout box indicator on GBPUSD M15 with the frozen session box and break marks
Breakout box indicator on GBPUSD M15 with the frozen session box and break marks

How the Breakout Box Indicator calculates its values

Tracking the session

`InpSession` picks a preset, defaulting to the Asian window. `InpCustomStartHour` `22` and `InpCustomEndHour` `7` cover the custom case, in server time. While a bar falls inside the window the code extends curHi and curLo to include it.

Freezing the box

When the session ends the two values stop moving. The buffers then carry the frozen high and low forward across every later bar. That is what turns a live range into a level you can trade against.

Marking the break

After the session a close above the frozen high writes a buy mark, and a close below the frozen low writes a sell. gap takes `InpArrowGapPoints` `20` times Point. The box then rolls forward to the next day automatically.

How to read the signals

The box is a range someone actually traded, not a rolling window.

A narrow box means the session was quiet, which often precedes a livelier one.

Both edges can break on the same day, and often do.

Server time matters here, so check your broker offset before trusting the preset.

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

`InpEnableAlerts` starts on and `InpEnablePopup` carries the text. `InpEnablePush`, `InpEnableEmail` and `InpEnableSound` begin false. `InpSoundFile` picks the clip. The break test reads a closed bar, and the guard allows one box message per bar.

Every Breakout Box Indicator input

Core settings

Setting What it does Default
InpSession Session preset. Session preset, defaulting to the Asian window. BBOX_ASIA
InpCustomStartHour Custom start hour (server time). Custom session start in server time, default `22`. 22
InpCustomEndHour Custom end hour (server time). Custom session end in server time, default `7`. 7
InpBoxFilled Filled rectangle. Fills the rectangle rather than outlining it, default `false`. off
InpMaxBoxes Max historic boxes to retain. How many historic boxes stay on the chart, default `10`. 10

Display settings

Setting What it does Default
InpDrawBox Draw rectangle on chart. Draws the rectangle on the chart, default `true`. on
InpBoxColor Box color. Box colour, default medium slate blue. medium slate blue
InpArrowGapPoints Arrow offset from bar (points). Mark distance from the bar in points, default `20`. 20

Alert settings

Setting What it does Default
InpEnableAlerts Master enable. Master switch for the box break alerts, default `true`. on
InpEnablePopup Popup alert. Terminal dialog on a box break, default `true`. on
InpEnablePush Push notification. Phone push on a box break, default `false`. off
InpEnableEmail Email alert. Mail delivery on a box break, default `false`. off
InpEnableSound Sound alert. Sound playback on a box break, default `false`. off
InpSoundFile Sound file. Wav clip for the box alert, default `alert.wav`. alert.wav
Breakout box indicator inputs: InpSession, InpCustomStartHour, InpCustomEndHour, InpMaxBoxes
Breakout box indicator inputs: InpSession, InpCustomStartHour, InpCustomEndHour, InpMaxBoxes

Settings that fit your chart

Session boxes want a chart fine enough to show the range and the break. GBPUSD M15 is the reference chart, where an Asian session covers around thirty bars. On M5 the box is wide in bar terms and easy to read. Above H1 the whole session shrinks to a handful of candles.

When the Breakout Box Indicator fails

The preset assumes a server time offset. A different broker shifts every session by hours.

A quiet session gives a tight box that price leaves almost immediately, in both directions.

The tool marks the break and stops. Nothing tracks whether the move held.

Copy the compiled Breakout Box 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.

Related on forexmt4systems.com: London Session Breakout plan.

Download the Breakout Box Indicator for MT4 and MT5

The zip holds the compiled Breakout Box 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 hours does InpSession cover by default?

The Asian window, as a preset. If you need something else, the custom pair `InpCustomStartHour` `22` and `InpCustomEndHour` `7` sets it directly. Both figures are server time rather than your local clock, which is the usual trap here.

Why does the box freeze at session close?

Because a range that keeps moving is not a level. Once the window ends, the high and low stop updating and the buffers carry them forward. Only then can a later close be measured against something fixed.

How many boxes does InpMaxBoxes keep?

Ten by default, counting backwards from today. Older rectangles get removed so the chart does not fill with objects. Raise it when you want to study how previous sessions broke, or lower it for a cleaner screen.

Does InpBoxFilled change any logic?

No. It only decides whether the rectangle is drawn as an outline or a solid block. The high and low values, the break test and the alerts all behave the same either way. Filled boxes can hide candles, so most traders leave it false.

Are results guaranteed?

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

Category: this is part of our Signal and Forecast collection. Also, browse more Signal and Forecast for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.

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