Institutional multi-session compression expansion framework with Daily trend alignment
Requires healthy directional volatility on the Daily timeframe (ADR > 75% of 20-day average). Strict trading blackout 30 minutes before and 15 minutes after high-impact macroeconomic releases (e.g., US NFP, CPI, FOMC, and relevant Central Bank interest rate releases). Avoid trading during late-December bank liquidity holidays.
Validate every condition prior to executing order.
GBPUSD traded consistently above its rising Daily 50 EMA. A 64-pip Mother Bar formed during the Asian session, followed by an Inside Bar compression of 35 pips. At the London/NY overlap, an H4 candle closed decisively at 1.2680 (above the Mother Bar high of 1.2675). Entry triggered at 1.2680 with Stop Loss placed 5 pips below the Inside Bar low at 1.2635 (45 pips total risk). Momentum expanded cleanly, reaching 1.2725 (+1.0R) where 50% was secured and SL moved to Breakeven, before printing 1.2770 during the next session to hit the full 1:2 R:R target.
EURJPY was aligned below the Daily 50 EMA in an established short trend. An H4 Inside Bar formed below resistance. Candle[0] pushed through the Mother Bar low of 161.45, closing at 161.40 to trigger a short entry. Stop Loss was anchored at 161.85 (above the Inside Bar high). Immediately into the Tokyo open, Japanese MoF jawboning triggered rapid spot buying, forcing an aggressive reversal. The trade was stopped out strictly at 161.85 for a controlled 1.0R loss, preventing severe drawdown as the pair rallied over 180 pips.
Copy code directly into TradingView Pine Editor
//@version=5
strategy("H4 Inside Bar Momentum Breakout [QuantLab]", overlay=true, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=1.0, commission_type=strategy.commission.percent, commission_value=0.006, slippage=1)
// -----------------------------------------------------------------------------
// INPUT PARAMETERS
// -----------------------------------------------------------------------------
grp_trend = "Trend & Filter Configuration"
daily_ema_len = input.int(50, title="Daily EMA Length", group=grp_trend)
use_daily_filter = input.bool(true, title="Enforce Daily EMA Filter", group=grp_trend)
grp_risk = "Risk & Money Management"
risk_reward_ratio = input.float(2.0, title="Risk:Reward Ratio", minval=1.0, step=0.1, group=grp_risk)
buffer_ticks = input.int(30, title="Stop Buffer (Ticks / Sub-pips)", minval=0, group=grp_risk)
// -----------------------------------------------------------------------------
// INDICATOR & FILTER COMPUTATION
// -----------------------------------------------------------------------------
// Fetch Daily EMA using request.security
daily_ema = request.security(syminfo.tickerid, "D", ta.ema(close, daily_ema_len), lookahead=barmerge.lookahead_off)
daily_bullish = not use_daily_filter or (close > daily_ema)
daily_bearish = not use_daily_filter or (close < daily_ema)
plot(daily_ema, title="Daily EMA Filter", color=color.new(color.orange, 20), linewidth=2)
// -----------------------------------------------------------------------------
// PATTERN IDENTIFICATION (Mother Bar & Inside Bar)
// -----------------------------------------------------------------------------
// Bar [2] is Mother Bar, Bar [1] is Inside Bar, Bar [0] is Breakout Trigger Bar
mother_high = high[2]
mother_low = low[2]
inside_high = high[1]
inside_low = low[1]
is_inside_bar = (inside_high <= mother_high) and (inside_low >= mother_low)
// Long Condition: Inside bar verified, Daily trend is Bullish, and Current H4 candle closes ABOVE Mother Bar High
valid_long_breakout = is_inside_bar and daily_bullish and (close > mother_high) and (strategy.position_size == 0)
// Short Condition: Inside bar verified, Daily trend is Bearish, and Current H4 candle closes BELOW Mother Bar Low
valid_short_breakout = is_inside_bar and daily_bearish and (close < mother_low) and (strategy.position_size == 0)
// -----------------------------------------------------------------------------
// TRADE EXECUTION & RISK MANAGEMENT
// -----------------------------------------------------------------------------
var float trade_sl = na
var float trade_tp = na
tick_val = syminfo.mintick * buffer_ticks
if (valid_long_breakout)
trade_sl := inside_low - tick_val
risk_dist = close - trade_sl
if risk_dist > 0
trade_tp := close + (risk_dist * risk_reward_ratio)
strategy.entry("Long_IB", strategy.long)
strategy.exit("Exit_Long", from_entry="Long_IB", stop=trade_sl, limit=trade_tp)
if (valid_short_breakout)
trade_sl := inside_high + tick_val
risk_dist = trade_sl - close
if risk_dist > 0
trade_tp := close - (risk_dist * risk_reward_ratio)
strategy.entry("Short_IB", strategy.short)
strategy.exit("Exit_Short", from_entry="Short_IB", stop=trade_sl, limit=trade_tp)
// Reset targets on position flat
if (strategy.position_size == 0)
trade_sl := na
trade_tp := na
// -----------------------------------------------------------------------------
// VISUALIZATION
// -----------------------------------------------------------------------------
plotshape(is_inside_bar[0] == false and is_inside_bar, title="Inside Bar Identified", style=shape.diamond, location=location.abovebar, color=color.aqua, size=size.tiny, offset=-1)
plotshape(valid_long_breakout, title="Long Entry Trigger", style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small)
plotshape(valid_short_breakout, title="Short Entry Trigger", style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small)
plot(strategy.position_size != 0 ? trade_sl : na, title="Active Stop Loss", color=color.red, style=plot.style_linebr, linewidth=1)
plot(strategy.position_size != 0 ? trade_tp : na, title="Active Take Profit", color=color.green, style=plot.style_linebr, linewidth=1)
Placing the SL beyond the Inside Bar extreme provides an optimal risk-to-reward profile (often doubling potential R-multiples). If price breaches back through the Inside Bar after an expansion close, the initial momentum hypothesis has failed, making early exit mathematically optimal.
Yes. A series of consecutive inside bars indicates even tighter multi-candle volatility contraction. In such events, the SL is anchored to the most immediate inside bar extreme prior to breakout, yielding higher explosive potential.
If the breakout close coincides with or is caused directly by high-impact economic news releases (e.g. FOMC, CPI), avoid execution. News-driven breakouts are prone to aggressive mean-reversion liquidity traps.
The core edge of the H4 Inside Bar Momentum Breakout Strategy model relies on the structural imbalance created when large market participants (commercial banks, liquidity providers, and central clearing desks) aggregate retail stop orders. Rather than anticipating trend continuation from arbitrary retail indicators, this systematic model identifies pre-existing liquidity pools—such as session highs/lows, Asian range extremes, or equal highs/lows (EQH/EQL)—where retail stop losses are heavily clustered.
Once a targeted liquidity sweep occurs and price aggressively rejects back inside the defined equilibrium range, an order flow displacement is confirmed through a Market Structure Break (MSB) or Change of Character (CHoCH). This sequence establishes asymmetric risk-to-reward parameters, allowing traders to enter with tight structural stops positioned outside the invalidated sweep candle.
Higher timeframe (H4/Daily) structural bias must always govern lower timeframe (M15/M5/M1) execution. Trading with the prevailing institutional order flow drastically reduces whipsaws during choppy session opens.
Always factor in spread expansion during high-impact news releases (CPI, NFP, FOMC) and daily 5:00 PM EST session rollover. Never enter within 15 minutes before Tier-1 macroeconomic events.
Move stop loss to break-even once price reaches 1.0R–1.5R target expansion or mitigates an opposing Fair Value Gap (FVG), neutralizing risk on active positions.
To successfully navigate proprietary trading evaluation stages without breaching maximum daily drawdown (typically 4%–5%) or maximum overall loss limits (8%–10%), this model must be deployed with disciplined position sizing:
On a $100,000 challenge account, 0.5% risk limits single trade exposure to $500. Six consecutive losses would total $3,000 (3% of total account capital), representing the majority of a typical 4%–5% daily drawdown threshold. The 2-loss session circuit breaker below stops total loss at $1,000 (1%) to protect your evaluation buffer.
If two consecutive setups trigger stop-loss invalidations within the same trading session, trading must be suspended for the remainder of that session to avoid revenge trading and emotional capital destruction.
Discretionary traders can execute this system manually using our pre-trade checklist above, while quantitative and algorithmic traders can deploy the Pine Script logic or connect directly to automated trading software:
Discover compiled MT4/MT5 Expert Advisors executing systematic order blocks around the clock.
Mirror institutional setups automatically into your MT4/MT5 broker account with zero latency.
Access 20+ verified institutional systems across Asian, London, and New York trading sessions.
Quant Note: Backtested using institutional-grade tick data across GBPUSD, EURJPY, and AUDUSD on H4 timeframe. Commission modeled at $6.00/lot round-turn with 0.8 pip average slippage factored into execution.
Download a clean, printer-friendly 1-page cheatsheet containing all entry/exit rules and the checklist for your trading desk.
Open Print / PDF ViewSubscribe to receive verified Pine Script algorithms, quantified backtests, and fresh pre-trade checklists directly to your inbox every week.
Download the complete quantitative guide: Position Sizing Formulas, Prop Firm Drawdown Rules, and MQL5 Parameter Cheat Sheets.