Skip to content

Free MT5 indicator

Inside Bar Breakout

Finds inside-bar setups, boxes the mother bar's range and plots an arrow when a candle closes beyond the mother bar high or low.

Breakoutv1.0MetaTrader 5 (MQL5) Compiles with 0 errors Non-repainting signals Alerts

What it does

FXP Inside Bar Breakout spots inside bars, candles that trade entirely within the range of the previous candle (the mother bar), and turns them into a breakout setup. The mother bar's high and low are boxed, the box extends while the setup is pending, and the first candle that closes beyond the mother bar gets an arrow.

The box changes color to show the outcome: blue after an upside breakout, red after a downside breakout, grey if the setup expired without a break.

How it works

  1. A setup starts when a closed candle has a lower high and a higher low than the candle before it. The earlier candle is the mother bar.
  2. Optional size filter: the mother bar's range (high minus low) must be at least X times the 14-period ATR (Wilder smoothing). This skips tiny mother bars during quiet periods.
  3. While the setup is active, each closed candle is tested:
    • Close above mother high + buffer: upside breakout, arrow below the candle, box turns blue.
    • Close below mother low - buffer: downside breakout, arrow above the candle, box turns red.
    • Wicks outside the mother bar with a close back inside do not count.
  4. If no close breaks out within the allowed number of bars after the inside bar, the setup expires and the box turns grey. Only one setup is tracked at a time; a new inside bar can start a new setup only after the previous one has ended.
  5. All logic runs on closed candles and only new bars are processed.

How to use it

Copy the .ex5 file into MQL5/Indicators and attach it to a chart.

An inside bar is a pause: the market traded less than in the previous candle. A close out of the mother bar shows which side resolved the pause. Many traders take only breakouts in the direction of the prevailing trend, place the stop on the other side of the mother bar or at its midpoint, and size the trade with a lot size calculator. Daily and H4 inside bars are generally more meaningful than intraday ones.

Large mother bars after a strong move often work as continuation patterns; inside bars at key resistance can also precede reversals.

Settings

InputDefaultWhat it changes
Min mother bar range (x ATR)0.8Filters small setups; 0 disables.
ATR period14Volatility reference.
Bars allowed for the breakout10Expiry of a pending setup.
Extra distance beyond the mother bar (pips)0.0Buffer that the close must clear.
History bars to analyse2000Look-back for drawing.
Pending / up / down / expired box colorsvariousBox colors by outcome.
Max boxes kept on chart40Cap on boxes.
Alert on breakoutfalseOne alert per bar.
Also send push notificationfalseSends alerts to the mobile app.

Limitations

  • Breakouts from inside bars often reverse back into the mother bar, especially in ranging markets.
  • Waiting for a close confirms the break but gives a worse entry than a stop order at the mother bar edge.
  • Inside bars depend on how your broker's server time cuts candles, particularly on D1.
  • Only one setup is tracked at once, so overlapping setups are not shown. Trading involves substantial risk of loss.

Key inputs

Key inputs of Inside Bar Breakout
InputDefaultDescription
Min mother bar range (x ATR, 0 = off)0.8Ignores setups whose mother bar is small relative to the ATR.
ATR period14Bars used for the Average True Range.
Bars allowed for the breakout after the inside bar10The setup expires if no close breaks out within this many bars.
Extra distance beyond the mother bar (pips)0.0Buffer the breakout close must clear.
Max boxes kept on chart40Older setup boxes are deleted beyond this count.
Alert on breakout (once per bar)falseAlerts when the last closed candle breaks the mother bar.

Educational tools, not advice. Indicators and Expert Advisors describe price; they do not predict it, and past behaviour does not guarantee future results. Test everything on a demo account first and never risk money you cannot afford to lose. See our disclaimer.

Keep exploring

Related mt5 indicators