Blog / Strategy
Strategy

Nested Inside Bar Breakout

Disclaimer: This article is for educational and informational purposes only. It does not constitute financial or investment advice. Trading forex and CFDs carries significant risk of loss. Past performance of any strategy — including backtests — does not guarantee future results. Never trade with money you cannot afford to lose.

What Is This Strategy?

The Nested Inside Bar Breakout is a pure price-action breakout strategy that uses a stacked inside bar pattern — no moving averages, oscillators, or other indicators are involved. An inside bar is a candle whose entire range (its high and low) sits within the range of the candle before it, which is a classic signal that price is contracting and volatility is being squeezed out of the market. This strategy looks for two inside bars in a row — a "nest" — to confirm an unusually tight coil before acting.

The approach is designed for volatility-contraction conditions: quiet, range-bound moments when the market coils into a progressively narrower range before releasing into a directional move. In trading terms, this is a breakout or "volatility expansion" style. The core idea is that when each new candle prints fully inside the previous one, buy and sell stop orders tend to stack just beyond the surrounding "mother" bar's high and low. When price finally pushes through one of those extremes, the cascade of stops can produce a sharp, one-directional expansion — and the strategy aims to ride that first move.

As a learning tool, this strategy is well suited to traders who want to study price action and pattern recognition without the lag or clutter of indicators. It is a compact, transparent example of how a compression-then-expansion model is built: how a pattern is detected on closed bars, how an intrabar trigger is defined, and how stops and targets are anchored to actual market structure. Treat it as a study of breakout mechanics rather than a profit opportunity, and test it thoroughly before considering any live use.

How It Works

The strategy operates on closed bars for pattern detection and watches the forming (live) bar intrabar for the breakout trigger. It references four candles by their "shift" (how many bars back from the current one):

Entry conditions — the strategy signals a setup only when all of these are true:

Breakout trigger (watched intrabar on the forming bar):

Stop-loss logic:

Take-profit logic:

Trade management and self-expiry:

nested inside bar breakout MT5
Illustrative example of the strategy’s entry and exit logic — not real trading results.

Strategy Parameters

Parameter Default Min Max Description
ContractionRatio 0.80 0.40 1.00 The inner inside bar's range as a maximum fraction of the mother bar's range. Lower values demand a tighter coil before a setup is valid; higher values are more permissive.
BufferPoints 15 0 80 The buffer, in points, placed beyond the mother bar extreme for the breakout trigger and beyond the coil extreme for the stop. Larger values reduce false triggers but widen risk.
RewardRisk 2.0 1.0 5.0 The take-profit reward-to-risk multiple. A value of 2.0 sets the target twice as far from entry as the stop-loss.
Lots 0.10 0.01 1.00 The fixed trade volume in lots. This is normalized to the broker's volume step and clamped to its minimum and maximum allowed size.
nested inside bar breakout MT5 — MQL5 source code

Recommended Chart Settings

This strategy is a generic price-action model and is not hard-coded to one instrument. It is most commonly studied on liquid forex pairs and major indices where inside-bar nests form cleanly. A practical starting point is a single major forex pair (for example, a EUR or GBP pair) on an intraday timeframe such as M15, M30, or H1, where compression-then-expansion cycles are frequent enough to study but each bar still carries meaningful structure.

Because the strategy reacts to the buffer and stop distances in points, the appropriate BufferPoints value will differ between instruments with different point sizes and typical volatility. Always re-test the parameters on the specific symbol and timeframe you intend to study. Results will vary considerably across different market conditions, sessions, and instruments, so treat any single configuration as a starting hypothesis rather than a finished setting.

How to Install on MetaTrader 5

What to Consider Before Using This EA

Strengths. The logic is transparent and indicator-free, so every decision can be traced directly to candle structure. Risk is defined before entry — the stop is anchored to the coil and the target is a multiple of that risk — which makes the strategy a clear teaching example of structured, asymmetric risk-to-reward. The self-expiring nature of the pattern also avoids holding stale signals, and the one-attempt-per-bar guard prevents repeated firing inside a single candle.

Known limitations. Inside-bar breakouts are prone to false breakouts, where price pokes through the mother extreme, triggers the entry, then reverses back into the range. In choppy, low-momentum markets, this can produce a series of small losses. The nested two-bar requirement is strict, so genuine setups can be relatively rare, and the strategy will sit idle for long stretches — which is normal for a selective breakout model. Because entries are taken at market on the live break, slippage and spread can meaningfully affect the realized entry price and the effective risk-to-reward.

Where it may underperform. Strongly trending markets that never compress, news-driven gaps, and very tight, illiquid instruments can all degrade the pattern's reliability. The fixed reward-to-risk target means the strategy will not capture extended runs beyond its take-profit, nor will it adapt to changing volatility on its own. None of this makes the approach good or bad — it simply means the model has a defined comfort zone, and understanding that zone is part of using it responsibly.

Risk Management Tips

Sound risk management matters more than any single entry rule. Consider the following general principles as you study this strategy:

Risk Warning

Trading foreign exchange, CFDs, and other leveraged financial instruments involves substantial risk of loss and is not suitable for all investors. The strategies and tools discussed on this page are provided for educational purposes only and do not constitute financial advice, investment recommendations, or solicitation to trade. Always consult a qualified financial adviser before making trading decisions. Past backtest performance is not indicative of future results.

Downloads

← Back to Blog