Institutional continuation divergence engine filtering RSI momentum resets within macro trend flows
Requires Average True Range (ATR 14) to be above its 20-period moving average to guarantee sufficient expansion. Avoid execution during flat Asian sessions or major high-impact macroeconomic events (e.g., BoJ Rate Decisions, UK CPI, US NFP). Optimal performance occurs during London Open (07:00 UTC) and the London/New York overlap.
Validate every condition prior to executing order.
During the London session, GBPJPY was trading steadily above both the 50 and 200 EMAs. A sharp pull-back created a new lower price low at 191.400, while RSI(14) printed a clear higher low at 34 vs previous 28. ATR was elevated, confirming liquid conditions. Upon the M15 candle closing at 191.450, a Long entry was executed. Price resumed macro impulse, reaching +1R inside 45 minutes (SL shifted to BE) and cleanly hitting the 1:2 TP target at 192.050 within 2 hours.
GBPJPY was in a macro downtrend under EMA 200. A bearish divergence printed as price pushed to a marginal new high at 193.180 while RSI made a lower high. Position opened short on M15 close at 193.200. However, high-impact UK news flow triggered sudden buying volume, breaking through resistance and hitting the SL at 193.500. Strict 1% position sizing limited drawdown to standard parameters.
Copy code directly into TradingView Pine Editor
//@version=5
strategy("GBPJPY Trend-Aligned RSI Divergence Strategy", overlay=true, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=1, commission_type=strategy.commission.percent, commission_value=0.03)
// --- Inputs ---
rsiPeriod = input.int(14, "RSI Period", minval=1)
rsiLookback = input.int(20, "Divergence Lookback", minval=5)
emaFastLen = input.int(50, "Fast EMA", minval=1)
emaSlowLen = input.int(200, "Slow EMA", minval=1)
atrLen = input.int(14, "ATR Length", minval=1)
atrMult = input.float(1.5, "ATR Stop Loss Multiplier", minval=0.5, step=0.1)
rrRatio = input.float(2.0, "Risk to Reward Ratio", minval=1.0, step=0.1)
useVolFilter = input.bool(true, "Filter Low Volatility (ATR > ATR SMA)")
// --- Indicators ---
rsi = ta.rsi(close, rsiPeriod)
emaFast = ta.ema(close, emaFastLen)
emaSlow = ta.ema(close, emaSlowLen)
atr = ta.atr(atrLen)
atrFilter = not useVolFilter or (atr > ta.sma(atr, 20))
// Trend Alignment
bullishTrend = close > emaSlow and emaFast > emaSlow
bearishTrend = close < emaSlow and emaFast < emaSlow
// --- Pivot Detection for Divergence ---
pvtLow = ta.pivotlow(rsi, 5, 5)
pvtHigh = ta.pivothigh(rsi, 5, 5)
var float lastRsiLow = na
var float prevRsiLow = na
var float lastPriceLow = na
var float prevPriceLow = na
var float lastRsiHigh = na
var float prevRsiHigh = na
var float lastPriceHigh = na
var float prevPriceHigh = na
bool bullDiv = false
bool bearDiv = false
if not na(pvtLow)
prevRsiLow := lastRsiLow
lastRsiLow := pvtLow
prevPriceLow := lastPriceLow
lastPriceLow := low[5]
if not na(prevRsiLow) and not na(prevPriceLow)
if lastRsiLow > prevRsiLow and lastPriceLow < prevPriceLow
bullDiv := true
if not na(pvtHigh)
prevRsiHigh := lastRsiHigh
lastRsiHigh := pvtHigh
prevPriceHigh := lastPriceHigh
lastPriceHigh := high[5]
if not na(prevRsiHigh) and not na(prevPriceHigh)
if lastRsiHigh < prevRsiHigh and lastPriceHigh > prevPriceHigh
bearDiv := true
// --- Entry Conditions ---
longCondition = bullDiv and bullishTrend and atrFilter
shortCondition = bearDiv and bearishTrend and atrFilter
var float longSL = na
var float longTP = na
var float shortSL = na
var float shortTP = na
if longCondition and strategy.position_size == 0
longSL := close - (atr * atrMult)
longTP := close + ((close - longSL) * 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)
shortTP := close - ((shortSL - close) * rrRatio)
strategy.entry("Short", strategy.short)
strategy.exit("Exit Short", "Short", stop=shortSL, limit=shortTP)
// Plotting
plot(emaFast, "EMA 50", color=color.blue, linewidth=2)
plot(emaSlow, "EMA 200", color=color.orange, linewidth=2)
plotshape(longCondition, title="Bullish Divergence", style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small)
plotshape(shortCondition, title="Bearish Divergence", style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small)
Counter-trend divergences regularly fail during strong institutional trends, causing severe drawdown. Trading continuation divergences ensures you align with dominant order flow.
Yes, high-beta pairs like EURJPY, GBPUSD, and Gold (XAUUSD) perform very well with this exact logic due to their strong trending characteristics.
It is best practice to close open positions or move stop losses to break-even at least 15 minutes prior to high-impact UK/JP/US news releases.
The core edge of the GBPJPY Trend-Aligned RSI Divergence 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 with realistic 1.5 pip GBPJPY spread and 0.2 pip slippage per trade on M15 timeframe.
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.