Institutional trend-following and momentum breakout system utilizing structural swing confirmation and dynamic ATR risk controls.
Requires normal to high volatility conditions. Optimal performance occurs during London and New York session overlaps when Average Daily Range (ADR) expansion is active. Avoid setups when 14-period ATR drops below 5 pips on M15 (low liquidity squeeze). Hard rule: Blackout trading 30 minutes before and after high-impact tier-1 news releases (NFP, CPI, FOMC, Rate Decisions).
Validate every condition prior to executing order.
GBPUSD traded above the 200 EMA during early London session. MACD histogram crossed above zero. An M15 candle closed strongly above the previous 10-bar swing high (1.2648). Entry triggered at 1.2650. Price rallied directly to target within 2 hours, reaching +2R without hitting breakeven trailing stop.
Price was above 200 EMA and MACD histogram flipped positive. M15 candle closed above swing high at 1.0850. Trade entered long. However, institutional sellers defended the higher timeframe resistance point. Price reversed sharply into a liquidity sweep, hitting the 12-pip ATR stop loss. Capital was strictly preserved at 1% max risk.
Copy code directly into TradingView Pine Editor
//@version=5
strategy("200 EMA & MACD Momentum Breakout Strategy", overlay=true, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=1.0, commission_type=strategy.commission.cash_per_contract, commission_value=0.000035)
// --- INPUTS ---
emaLen = input.int(200, "200 EMA Period", minval=1)
fastLen = input.int(12, "MACD Fast Length")
slowLen = input.int(26, "MACD Slow Length")
signalLen = input.int(9, "MACD Signal Length")
swingLen = input.int(10, "Swing Lookback Period")
atrLen = input.int(14, "ATR Period")
atrMult = input.float(1.5, "ATR SL Multiplier", step=0.1)
rrRatio = input.float(2.0, "Risk to Reward Ratio", step=0.1)
minAtrPips = input.float(5.0, "Min ATR Filter (Pips)", step=0.5)
// Session Inputs
useSession = input.bool(true, "Filter Trading Hours")
sessionTime = input.session("0700-2000:23456", "Trading Session (UTC)")
// --- INDICATORS ---
ema200 = ta.ema(close, emaLen)
[macdLine, signalLine, hist] = ta.macd(close, fastLen, slowLen, signalLen)
atr = ta.atr(atrLen)
// Swing High / Low
swingHigh = ta.highest(high[1], swingLen)
swingLow = ta.lowest(low[1], swingLen)
// Session and Volatility Checks
inSession = not useSession or not na(time(timeframe.period, sessionTime))
atrPips = atr / syminfo.mintick / 10
atrValid = atrPips >= minAtrPips
// Crossover conditions within recent bars
macdCrossUp = ta.crossover(hist, 0)
macdCrossDown = ta.crossunder(hist, 0)
recentCrossUp = ta.barssince(macdCrossUp) <= 3
recentCrossDown = ta.barssince(macdCrossDown) <= 3
// --- ENTRY CONDITIONS ---
longCondition = inSession and atrValid and close > ema200 and close > swingHigh and hist > 0 and recentCrossUp
shortCondition = inSession and atrValid and close < ema200 and close < swingLow and hist < 0 and recentCrossDown
// --- TRADE EXECUTION ---
var float longSL = 0.0
var float longTP = 0.0
var float shortSL = 0.0
var float shortTP = 0.0
if (longCondition and strategy.position_size == 0)
longSL := close - (atr * atrMult)
longRisk = close - longSL
longTP := close + (longRisk * rrRatio)
strategy.entry("Long", strategy.long)
strategy.exit("Exit Long", "Long", stop=longSL, limit=longTP)
if (shortCondition and strategy.position_size == 0)
shortSL := close + (atr * atrMult)
shortRisk = shortSL - close
shortTP := close - (shortRisk * rrRatio)
strategy.entry("Short", strategy.short)
strategy.exit("Exit Short", "Short", stop=shortSL, limit=shortTP)
// Trailing to Breakeven at +1R
if (strategy.position_size > 0)
riskDist = strategy.position_avg_price - longSL
if (close >= strategy.position_avg_price + riskDist)
strategy.exit("Exit Long", "Long", stop=strategy.position_avg_price, limit=longTP)
if (strategy.position_size < 0)
riskDist = shortSL - strategy.position_avg_price
if (close <= strategy.position_avg_price - riskDist)
strategy.exit("Exit Short", "Short", stop=strategy.position_avg_price, limit=shortTP)
// --- VISUALIZATION ---
plot(ema200, "200 EMA", color=color.rgb(33, 150, 243), linewidth=2)
plot(swingHigh, "Swing High", color=color.new(color.green, 50), style=plot.style_stepline)
plot(swingLow, "Swing Low", color=color.new(color.red, 50), style=plot.style_stepline)
bgcolor(inSession ? color.new(color.gray, 95) : na, title="Active Session")
Yes, the core indicators (200 EMA, MACD, Swing Breaks) scale well to higher timeframes. Adjust ATR filters and swing lookback values accordingly.
Fixed pip stops fail across fluctuating market regimes. ATR dynamic stops adapt to current asset volatility, preventing premature stop-outs during high-volatility environments.
The signal expires if structure is not broken within 3 bars of the MACD cross, preventing late entries into exhausted momentum.
The core edge of the 200 EMA & MACD Momentum Structure 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 15-minute timeframe on EURUSD and GBPUSD. Model accounts for 1.2 pips floating spread and $3.50 commission per round lot.
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.