OPEN-SOURCE SCRIPT
Order Blocks (Lite & Strict) [VBS]

VictoryByStrategy • Order Blocks ONLY (Lite & Strict) is a clean and focused Order Block indicator designed for traders who prefer clarity over clutter.
Unlike multi-layered “SMC dashboards” that overload the chart with structure, gaps, liquidity, and internal shifts, this script does one thing — and does it well:
Detects strict bullish and bearish Order Blocks based on confirmed swing breaks.
This version is intentionally lightweight:
* Maximum 3–5 active Order Blocks
* Strict mitigation rules
* Dynamic visibility (text only appears when price is inside the zone)
* Automatic invalidation handling
* Clean, professional visual behavior
It is built for traders who want actionable zones without visual noise.
How It Works :
[1] Structure break is detected using confirmed swing pivots (non-repaint pivots).
[2] The last opposite candle before the break defines the Order Block.
[3] The zone remains active until invalidated (based on Close or Wick logic).
[4] When price touches the zone:
[ ]* Header appears dynamically.
[ ]* Status changes to “Mitigated”.
[5] When invalidated:
[ ]* Status changes to “Inv”
[ ]* Box is removed after a configurable hold period.
No unnecessary overlays. No zigzag lines. No excessive filtering.
Just structure → block → reaction.
Best Markets / Pairs
This indicator works best on liquid markets where structure is respected:
Forex
EURUSD
GBPUSD
USDJPY
AUDUSD
Metals
XAUUSD (Gold) → especially strong with strict mitigation
XAGUSD
Crypto
BTCUSD
ETHUSD
Indices
US100 / NASDAQ
US500 / S&P
DAX
It performs best in markets with clear impulsive moves followed by retracements.
⏱ Ideal Timeframes
Scalping / Intraday
5m – 15m
Pivot Length: 7–9
Cooldown: 5–8
Intraday / Swing
1H – 4H
Pivot Length: 10–14
Cooldown: 8–12
Higher-Timeframe Bias Usage
Many traders use:
4H OBs for bias
15m/1H for entries
This script works well in that workflow.
⚙ Recommended Default Settings
For most users:
Swing Pivot Length: 10
Break Source: Close
Max Active OBs: 4
OB Range: Wick
Invalidation: Close
Cooldown: 8
Lookback: 120
Hold Invalidated OB: 3 bars
For more conservative traders:
Increase Pivot Length to 14
Keep Invalidation = Close
For aggressive traders:
Use Break Source = Wick
Lower Pivot Length to 7
Who This Is For
Traders who prefer clean structure-based trading
Smart Money / Order Flow traders
Break & Retest traders
Supply & Demand users who want strict zone invalidation
Traders tired of overly complex SMC scripts
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
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.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
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.