Inside Outside Bar Indicator: Two Patterns, Two Colours

Written by Dominic Walsh · Published · Last updated

The inside outside bar indicator marks the two simplest two-bar relationships there are. An inside bar sits entirely within the previous range. An outside bar swallows it. Lime green brackets the first case, red brackets the second, and a rectangle can frame the pair.

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 4: Inside Bar Top, Inside Bar Bot, Outside Bar Top, Outside Bar Bot
Alerts popup, push notification, email, sound
Inputs 12

What the Inside Outside Bar Indicator draws on the chart

Inside Bar Top and Inside Bar Bot bracket an inside bar in lime green.

Outside Bar Top and Outside Bar Bot bracket an outside bar in red.

OBJ_RECTANGLE objects frame the two bars when `DrawRectangles` is on.

Marks sit `ArrowOffsetPoints` `5` from the bar, which is deliberately tight.

  • Inside Bar Top: arrow, lime green, width 2, arrow code 234
  • Inside Bar Bot: arrow, lime green, width 2, arrow code 233
  • Outside Bar Top: arrow, red, width 2, arrow code 234
  • Outside Bar Bot: arrow, red, width 2, arrow code 233
Inside outside bar indicator on EURUSD H1 with bracketed inside and outside bars
Inside outside bar indicator on EURUSD H1 with bracketed inside and outside bars

How the Inside Outside Bar Indicator calculates its values

The two tests

inside needs the current high below the previous high and the current low above the previous low. outside needs the current high above and the current low below. Both conditions must hold, so a bar matching one extreme counts as neither.

Framing the pair

top takes the higher of the two highs and bot the lower of the two lows. The rectangle spans that range across both bars. `RectTransparency` `0` keeps it as an outline rather than a filled block.

Capping the objects

`MaxRectObjects` `200` bounds how many rectangles stay on the chart. Both patterns are common, so without a cap a long history would leave the terminal drawing thousands of objects.

How to read the signals

An inside bar means the market paused inside the previous range.

An outside bar means it covered more ground than the bar before.

The two often appear near each other, which is normal in a choppy stretch.

Neither pattern carries direction, so the colours are labels rather than signals.

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

`EnableAlerts` starts on and `EnablePopup` carries the text. `EnablePushNotify`, `EnableEmail` and `EnableSound` begin false. `SoundFile` picks the clip. The pattern test reads two completed bars, and the guard allows one message per bar.

Every Inside Outside Bar Indicator input

Core settings

Setting What it does Default
RectTransparency 0 = solid borders, no fill. Set to `0` for outlines with no fill. 0
MaxRectObjects cap visible rectangle objects. Cap on visible rectangles, default `200`. 200

Display settings

Setting What it does Default
DrawRectangles draw rectangles around detected bars. Draws a rectangle around each detected pair, default `true`. on
InsideColor Inside bar colour, default lime green. lime green
OutsideColor Outside bar colour, default red. red
ArrowOffsetPoints arrow vertical offset from bar high/low. Bracket distance from the bar in points, default `5`. 5

Alert settings

Setting What it does Default
EnableAlerts Master switch for the bar pattern alerts, default `true`. on
EnablePopup Terminal dialog on a bar pattern, default `true`. on
EnablePushNotify Phone push on a bar pattern, default `false`. off
EnableEmail Mail delivery on a bar pattern, default `false`. off
EnableSound Sound playback on a bar pattern, default `false`. off
SoundFile Wav clip for the pattern alert, default `alert.wav`. alert.wav
Inside outside bar indicator inputs: DrawRectangles, MaxRectObjects, ArrowOffsetPoints
Inside outside bar indicator inputs: DrawRectangles, MaxRectObjects, ArrowOffsetPoints

Settings that fit your chart

Both patterns need bars with meaningful ranges. EURUSD H1 is the reference chart, where each pattern covers two hours of trade. On M1 and M5 they appear constantly and mean almost nothing. On H4 and daily each one describes a real change in how far price travelled.

When the Inside Outside Bar Indicator fails

Inside and outside bars are among the most common shapes on any chart.

Neither pattern says which way price goes next, so the marks are descriptive only.

A tight `ArrowOffsetPoints` keeps marks close, which can crowd a busy candle.

Copy the compiled Inside Outside Bar 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 Inside Outside Bar Indicator for MT4 and MT5

The zip holds the compiled Inside Outside Bar 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 separates an inside bar from an outside bar?

Which way the comparison goes. inside needs both the high lower and the low higher than the previous bar. outside needs both the high higher and the low lower. A bar matching only one side is neither, so it gets no marks.

What does RectTransparency at 0 give?

A rectangle drawn as an outline with no fill. That keeps the candles visible underneath, which matters because both patterns are about the bars themselves. Raise it if you would rather see a shaded block.

Why does MaxRectObjects cap at 200?

Because both patterns are extremely common. On a long chart the tool would otherwise create thousands of rectangles, and MetaTrader slows badly under that load. Two hundred covers a useful stretch of recent history.

Do the Inside Bar Top and Bot plots imply direction?

No. They simply bracket the bar above and below so it stands out. An inside bar is a pause, and it can resolve either way. Reading the colour as a buy or sell signal would misuse the tool.

Are results guaranteed?

No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Inside Outside Bar 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