OPEN-SOURCE SCRIPT

Smart Money Concepts Order Blocks, Liquidity [LunqFX]

13 230
Smart Money Concepts — Order Blocks & Liquidity [LunqFX]

A professional-grade SMC indicator that answers the three
questions every trader needs before entering a trade:
① What is the current trend?
② Where is the key institutional zone?
③ Is price at that zone right now?


📋 HOW TO USE — STEP BY STEP

The indicator works as a 3-step confirmation system.
Do not enter a trade unless all 3 align.

STEP 1 — READ THE TREND (panel header)

Look at the panel in the top-right corner.

▲ BULLISH → only look for LONG setups
▼ BEARISH → only look for SHORT setups

If the gauge bar shows less than 40% or more than 60%
— the bias is strong. Between 40–60% = no clear edge,
reduce position size or wait.

STEP 2 — WAIT FOR STRUCTURE EVENT

• BOS appears → trend continuation confirmed.
The market broke a key level and is likely to continue.
Look for entries in the direction of the break.

• CHoCH appears → trend is reversing.
This is the earliest signal of a new trend forming.
Higher risk, higher reward — wait for Step 3 to confirm.

Rule: never trade against the last structure signal.

STEP 3 — WAIT FOR PRICE TO RETURN TO THE OB ZONE

After BOS or CHoCH fires, an Order Block zone is drawn
on the chart (blue = bullish, pink = bearish).

Wait for price to pull back INTO that zone.

When price enters the zone:
→ The zone border brightens (active glow effect)
→ The panel "Zone" row shows ▲ BULL OB or ▼ BEAR OB
→ Candle color changes to the zone color

This is your entry window.

✅ FULL SETUP EXAMPLE (LONG)

ảnh chụp nhanh

1. Panel shows ▲ BULLISH
2. CHoCH or BOS fires bullish — structure confirmed
3. Blue Order Block zone is drawn below current price
4. Price pulls back into the blue zone
5. Panel Zone row shows "▲ BULL OB"
6. Enter long — Stop Loss below the OB zone bottom
7. Target: next swing high or previous resistance

✅ FULL SETUP EXAMPLE (SHORT)

1. Panel shows ▼ BEARISH
2. BOS fires bearish — downtrend continuation
3. Pink Order Block zone is drawn above current price
4. Price pulls back up into the pink zone
5. Panel Zone row shows "▼ BEAR OB"
6. Enter short — Stop Loss above the OB zone top
7. Target: next swing low or previous support

⚠️ WHAT TO AVOID

✗ Don't enter on the BOS/CHoCH candle itself —
wait for the pullback to the OB zone

✗ Don't trade a swept (faded/dashed) zone —
it was already mitigated, its edge is gone

✗ Don't fight the trend — if panel says BEARISH,
don't look for longs no matter how good it looks

✗ High ATR (volatile) = widen your stop loss
or reduce position size accordingly

🔷 ORDER BLOCKS
Automatically detects bullish and bearish Order Blocks —
the last opposing candle before a Break of Structure.
Zones use a 2-band gradient (dense core + lighter outer)
to visualize institutional demand and supply areas.

• Active glow: border brightens when price enters the zone
• Swept zones: automatically fade to dashed when mitigated
• Age-based cleanup: old zones removed after set bar count
• Mitigation mode: choose Close or Wick for zone removal

📐 BREAK OF STRUCTURE (BOS) & CHANGE OF CHARACTER (CHoCH)

BOS confirms trend continuation. CHoCH signals a trend
reversal. Only the most recent signal is displayed —
CHoCH automatically clears stale BOS, and BOS clears
stale CHoCH. No visual clutter.

• BOS: dashed line at broken structure level
• CHoCH: solid line with arrow label at pivot bar
• No repaint: all signals fire on confirmed closed candles only

💧 LIQUIDITY — Equal Highs / Equal Lows

Detects EQH and EQL liquidity pools — price levels where
stop-losses cluster. Marks them with dotted lines so you
can anticipate smart money liquidity sweeps.

⚡ FAIR VALUE GAPS (FVG)

Identifies bullish and bearish imbalance zones (3-candle
gaps). Optional — hidden by default to keep the chart clean.
Enable in settings when imbalance confluences matter.

🎨 MOMENTUM GRADIENT CANDLES
Every candle is colored by momentum strength relative to
the last 30 bars. Weak candles = dark muted shade. Strong
impulse candles = vivid bright color. Structure events
(CHoCH/BOS) override with accent colors.

📊 LIVE DASHBOARD PANEL

ảnh chụp nhanh

Top-right panel shows at a glance:
• Trend bias (BULLISH / BEARISH) + visual gauge bar
• Last BOS and CHoCH direction and time
• Current zone status (price inside OB?)
• Active Order Block count per side
• Last confirmed Swing High and Swing Low prices
• ATR(14) with volatility label (LOW / NORMAL / HIGH)
• No Repaint confirmation

✅ NO REPAINT — CONFIRMED CLOSE ONLY

All pivot detections use ta.pivothigh() / ta.pivotlow()
with confirmed lookback. All BOS/CHoCH signals require
barstate.isconfirmed. What you see is what happened —
no repainting, no false signals on open candles.

⚙️ SETTINGS

Structure:
• Swing Length (3–30 bars)
• Max BOS / CHoCH lines shown
• BOS line length
• Show/hide swing pivot markers

Order Blocks:
• Max OBs per side
• Max age in bars
• Swept zone display + age
• Mitigation mode: Close or Wick

Display:
• Momentum candle coloring on/off
• Dashboard panel on/off
• Fair Value Gaps on/off
• Equal H/L liquidity on/off

Works on all instruments and timeframes.
Best used on: Forex, Gold (XAUUSD), Indices, Crypto.
Recommended timeframes: 15m, 30m, 1H, 4H, 1D.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Thông báo miễn trừ trách nhiệm

Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.