OB Range Retest [Confirmed]OB Range Retest
Detects institutional order blocks using swing-based market structure breaks, then enforces a strict 3-stage qualification before firing any signal. Nothing draws on your chart until a full retest confirmation occurs — zero clutter, zero anticipation trades.
─────────────────────────────────────────────────────────────
CORE CONCEPT — WHY ORDER BLOCKS WORK
─────────────────────────────────────────────────────────────
When a large institutional participant needs to fill a significant position, they can't do it in a single candle without moving the market against themselves. Instead, they place layered orders at a specific price zone — the last opposing candle before a strong directional move. That candle becomes the Order Block.
After price leaves the OB zone and breaks structure, institutions often defend those same levels when price returns. The retest is the entry opportunity — you're joining the institutional defense of that zone, not chasing the initial move.
This indicator identifies that setup mechanically, with no subjective interpretation required.
─────────────────────────────────────────────────────────────
HOW IT WORKS — THE 3-STAGE PROCESS
─────────────────────────────────────────────────────────────
Every setup must pass through three mandatory stages before anything appears on your chart. No exceptions.
STAGE 1 — BREAK OF STRUCTURE
The indicator continuously tracks confirmed swing highs and lows. When price closes decisively beyond one of those levels, a Break of Structure is registered. This is close-based only — wick sweeps that don't close through the level are ignored entirely. A wick sweep is a stop hunt, not a structure break.
The swing level that broke becomes the liquidity target for the setup. A broken swing low becomes the SSL (sell-side liquidity) — the pool of stops that institutions just cleared. A broken swing high becomes the BSL (buy-side liquidity) — same concept on the other side.
At this point, the indicator scans backwards to identify the last candle in the opposing direction before the impulsive move began. That candle is the Order Block — the footprint of institutional activity. It is stored internally. Nothing draws on the chart yet.
STAGE 2 — SEPARATION AND ARMING
Once an OB is identified, the indicator waits for price to fully separate from the zone. This separation step confirms the move was real. If price just wobbles around the OB without actually leaving, the setup stays in WAITING — it's not ready.
The moment price closes cleanly outside the OB zone, the setup transitions to ARMED. It's now watching for the pullback.
A stale timeout runs in the background — if a setup sits in WAITING or ARMED for too long without triggering, it's automatically discarded. OBs from prior sessions have no relevance to current order flow. Dead zones get cleaned up silently.
STAGE 3 — RETEST CONFIRMATION
This is the only stage that matters for entry. The indicator requires two things to happen on the same bar:
A wick that reaches back into the OB zone — proving price tested the level and found liquidity there. And a close that confirms back inside the zone — proving the zone held and rejected price.
Both conditions must be true simultaneously. A wick that touches but closes back outside means the zone didn't hold — no signal. A close inside without a wick test means price gapped into the zone — that's not a clean retest either. The moment both conditions are met on a confirmed bar, everything fires at once.
─────────────────────────────────────────────────────────────
WHAT DRAWS ON THE CHART
─────────────────────────────────────────────────────────────
Until Stage 3 confirms, your chart is completely clean. On confirmation, all visuals appear simultaneously:
OB Box — The order block candle body, highlighted in red (bearish) or green (bullish). This is where the institutional orders were placed.
Range Box — A purple zone spanning from the OB boundary down to the liquidity level (SSL or BSL). This represents the full expected travel distance of the move — from where price should reverse to where the liquidity sits below or above.
Liquidity Line — A gold horizontal line at the SSL or BSL level. This is the institutions' original target — the pool of stops they were hunting when they created this OB.
SSS / SDD Line — A dashed line through the midpoint of the OB body. Supply Side Split for bearish setups, Demand Side Divide for bullish. Price often reacts precisely at this level on the way through the zone.
BOS Line — A dotted reference line at the level where structure broke. Shows the context for how this setup originated.
TP and SL Lines — Both calculated from the retest close price, giving you a consistent risk-reward reference regardless of OB size.
Entry Label — Direction, TP level, and SL level displayed cleanly at the signal bar.
Past setups stay visible in faded color as historical reference. Active setups are full color.
─────────────────────────────────────────────────────────────
TRADE MANAGEMENT
─────────────────────────────────────────────────────────────
One trade at a time. A global trade flag prevents overlapping entries. Even if multiple setups are simultaneously armed, only the first valid retest fires. No stacking, no compounding exposure.
Cooldown. A configurable bar gap is enforced between consecutive signals. Prevents rapid-fire entries in choppy conditions.
Three exit conditions, checked in priority order:
Take Profit — fires the moment price touches the TP level on any tick, intrabar. Stop Loss — fires the moment price touches the SL level on any tick, intrabar. Time Exit — if the trade hasn't resolved within the Max Bars setting, it closes at bar end.
TP and SL exits fire intrabar — you don't wait for the bar to close. On a 5-min chart, sitting in a losing trade for 4 minutes after SL is touched is unnecessary. The exit is immediate.
On any exit, the trade flag clears, all visuals fade to their historical colors, and an exit label marks the bar with the outcome and P&L percentage.
─────────────────────────────────────────────────────────────
DASHBOARD
─────────────────────────────────────────────────────────────
The horizontal cinema bar at the bottom of the chart gives you a full-picture view in real time across 10 sections:
Bear Setup — current state of the most recent bearish setup (WAIT / ARMED / ACTIVE)
Bear Data — OB price range and the BOS level that created it
Bull Setup — current state of the most recent bullish setup (WAIT / ARMED / ACTIVE)
Bull Data — OB price range and the BOS level that created it
RSI — 14-period RSI with live gauge bar, overbought/oversold labeled
Volume — current volume vs 20-bar average with surge detection
ATR — 14-period ATR and ATR as a percentage of price
Position — active trade direction and TP level
Trade Mgmt — SL level, bars remaining, and cooldown status (READY or countdown)
The dot indicators in the top-right of the bar show the state of all tracked setups at a glance — WAITING, ARMED, ACTIVE, DONE.
─────────────────────────────────────────────────────────────
WHY NO SIGNAL RIGHT NOW?
─────────────────────────────────────────────────────────────
A common question: the indicator fired a signal, the trade closed, and now nothing is happening even though price is moving.
This is by design. After a BOS, the OB forms near the origin of the move — often well above or below current price. For the signal to fire, price must rally back up to the supply zone (for bearish setups) or pull back down to the demand zone (for bullish setups) and retest it. The indicator doesn't chase. It waits for the institutional retest, which may take time or may never come if price keeps trending.
If you're seeing no signals, check the dashboard — if it shows ARMED, the setup is alive and watching. If it shows no active setups, a new BOS is needed.
─────────────────────────────────────────────────────────────
NON-REPAINTING
─────────────────────────────────────────────────────────────
Entry signals require a fully confirmed bar — no signals fire on the live bar until it closes. Swing pivots require confirmed bars on both sides before registering. BOS detection uses closing prices only.
Exit signals (TP and SL) fire intrabar by design — fast exits are preferable to sitting in a bad trade until bar close. Time exits fire at bar close. This gives you precise exits with non-repainting entries.
─────────────────────────────────────────────────────────────
RECOMMENDED SETTINGS
─────────────────────────────────────────────────────────────
MNQ / NQ Futures (5-min)
Swing Length 6 · BOS Lookback 17 · OB Scan Bars 13 · Max Setups 10
TP % 0.13 · SL % 3.0 · Max Bars 46 · Cooldown 5 · Stale Timeout 60
BTCUSDT (5-min)
Swing Length 6 · BOS Lookback 17 · OB Scan Bars 13 · Max Setups 10
TP % 0.13 · SL % 3.0 · Max Bars 46 · Cooldown 5 · Stale Timeout 120
─────────────────────────────────────────────────────────────
TIPS
─────────────────────────────────────────────────────────────
Pin the indicator to the right price scale (right-click scale → Lock Scale) for best visual experience while zooming.
Lower Swing Length on faster-moving markets for more signals, raise it for cleaner structure reads.
Stale Timeout of 60 equals roughly 5 hours on a 5-min chart — raise to 120-200 for crypto, which moves through structure more slowly.
Past setups stay visible in faded color as historical context — useful for reading how the market has been responding to structure over time.
─────────────────────────────────────────────────────────────
For educational and informational purposes only. Not financial advice.
Chỉ báo Pine Script®






















