OPEN-SOURCE SCRIPT
更新済 Validated Order Blocks with Fib Levels

This indicator automatically identifies and displays Smart Money Concepts (SMC) order blocks based on market structure breaks:
How it works:
Bearish Order Blocks (Red): Marks the last bullish candle before a swing high. The OB becomes valid when price breaks below the previous swing low, indicating institutional selling zones. Drawn from the candle's close (body top) to its low (bottom wick).
Bullish Order Blocks (Green): Marks the last bearish candle before a swing low. The OB becomes valid when price breaks above the previous swing high, indicating institutional buying zones. Drawn from the candle's high (top wick) to its close (body bottom).
Features:
Three Fibonacci retracement levels (50%, 75%, 100%) for each order block
Fib 100% faces downward on bearish OBs and upward on bullish OBs
Auto-validation: OBs are removed when price closes through them
Customizable: Adjustable swing detection, timeframe selection, and OB display limits
Optional Break of Structure (BOS) markers to show when OBs activate
Works on any timeframe with HTF analysis support
Perfect for identifying key institutional support/resistance zones and potential reversal areas.
How it works:
Bearish Order Blocks (Red): Marks the last bullish candle before a swing high. The OB becomes valid when price breaks below the previous swing low, indicating institutional selling zones. Drawn from the candle's close (body top) to its low (bottom wick).
Bullish Order Blocks (Green): Marks the last bearish candle before a swing low. The OB becomes valid when price breaks above the previous swing high, indicating institutional buying zones. Drawn from the candle's high (top wick) to its close (body bottom).
Features:
Three Fibonacci retracement levels (50%, 75%, 100%) for each order block
Fib 100% faces downward on bearish OBs and upward on bullish OBs
Auto-validation: OBs are removed when price closes through them
Customizable: Adjustable swing detection, timeframe selection, and OB display limits
Optional Break of Structure (BOS) markers to show when OBs activate
Works on any timeframe with HTF analysis support
Perfect for identifying key institutional support/resistance zones and potential reversal areas.
リリースノート
Validated Order Blocks with Fibonacci Levels v2This indicator automatically identifies and displays Smart Money Concepts (SMC) order blocks based on market structure breaks:
How it works:
Bearish Order Blocks (Red): Marks the last bullish candle before a swing high. The OB becomes valid when price breaks below the previous swing low, indicating institutional selling zones. Drawn from the candle's close (body top) to its low (bottom wick).
Bullish Order Blocks (Green): Marks the last bearish candle before a swing low. The OB becomes valid when price breaks above the previous swing high, indicating institutional buying zones. Drawn from the candle's high (top wick) to its close (body bottom).
Features:
Three Fibonacci retracement levels (50%, 75%, 100%) for each order block
Fib 100% faces downward on bearish OBs and upward on bullish OBs
Auto-validation: OBs are removed when price closes through them
Customizable: Adjustable swing detection, timeframe selection, and OB display limits
Optional Break of Structure (BOS) markers to show when OBs activate
Works on any timeframe with HTF analysis support
Perfect for identifying key institutional support/resistance zones and potential reversal areas.
Updates:
-Fixed issue with setting OBs to infinite extend
リリースノート
This indicator automatically identifies and displays Smart Money Concepts (SMC) order blocks based on market structure breaks:How it works:
Bearish Order Blocks (Red): Marks the last bullish candle before a swing high. The OB becomes valid when price breaks below the previous swing low, indicating institutional selling zones. Drawn from the candle's close (body top) to its low (bottom wick).
Bullish Order Blocks (Green): Marks the last bearish candle before a swing low. The OB becomes valid when price breaks above the previous swing high, indicating institutional buying zones. Drawn from the candle's high (top wick) to its close (body bottom).
Features:
Three Fibonacci retracement levels (50%, 75%, 100%) for each order block
Fib 100% faces downward on bearish OBs and upward on bullish OBs
Auto-validation: OBs are removed when price closes through them
Customizable: Adjustable swing detection, timeframe selection, and OB display limits
Optional Break of Structure (BOS) markers to show when OBs activate
Works on any timeframe with HTF analysis support
Perfect for identifying key institutional support/resistance zones and potential reversal areas.
Updates:
Fixed some errors in the settings menu:
-Default settings changed for more precise OBs
-Extend OBs infinitely fixed
リリースノート
Updates Made:Fixed Pine Script Syntax Error
Removed unsupported 2D array syntax (line[][])
Implemented three separate line arrays for the Fibonacci levels
Corrected Order Block Logic
Fixed identification of the last bullish candle before swing high (for bearish OB)
Fixed identification of the last bearish candle before swing low (for bullish OB)
Properly validates OBs when Break of Structure (BOS) occurs
Proper Order Block Structure
Bearish OB: From candle body top (close) to bottom wick (low)
Bullish OB: From top wick (high) to candle body bottom (close)
Fibonacci Level Display (50%, 75%, 100%)
Removed 0% level completely
Changed shaded area to only cover 50% to 100% zone (premium area)
Split into two boxes: 75-100% and 50-75% for proper shading
Bearish OB: 100% at bottom (facing down)
Bullish OB: 100% at top (facing up)
Visual Improvements
Made background colors lighter (transparency 90 vs 85)
Changed all Fibonacci lines to solid thick lines (width=2, removed dashed style)
Removed all percentage/price labels for cleaner chart
Default Settings Updated
Left bars for swing: 5 → 20
Right bars for swing: 5 → 20
Max valid OBs to keep: 3 → 10
Extend OBs: 200 → 0 (infinite by default)
Infinite Extension Implementation
Lines use extend=extend.right for true infinite extension
Boxes dynamically update on each bar to maintain 500-bar forward projection
Both elements create the effect of infinite extension into the future
Final Result: A clean, accurate order block indicator that identifies institutional supply/demand zones with proper Smart Money Concepts logic, featuring premium Fibonacci zones (50-100%) with infinite extension capability.
リリースノート
Updates Made to the Order Block Indicator:Fixed Pine Script Syntax Error
Removed unsupported 2D array syntax (line[][])
Implemented three separate line arrays for the Fibonacci levels
Corrected Order Block Logic
Fixed identification of the last bullish candle before swing high (for bearish OB)
Fixed identification of the last bearish candle before swing low (for bullish OB)
Properly validates OBs when Break of Structure (BOS) occurs
Proper Order Block Structure
Bearish OB: From candle body top (close) to bottom wick (low)
Bullish OB: From top wick (high) to candle body bottom (close)
Fibonacci Level Display (50%, 75%, 100%)
Removed 0% level completely
Changed shaded area to only cover 50% to 100% zone (premium area)
Split into two boxes: 75-100% and 50-75% for proper shading
Bearish OB: 100% at bottom (facing down)
Bullish OB: 100% at top (facing up)
Visual Improvements
Made background colors lighter (transparency 90 vs 85)
Changed all Fibonacci lines to solid thick lines (width=2, removed dashed style)
Infinite Extension Implementation
Lines use extend=extend.right for true infinite extension
Boxes dynamically update on each bar to maintain 500-bar forward projection
Both elements create the effect of infinite extension into the future
Final Result: A clean, accurate order block indicator that identifies institutional supply/demand zones with proper Smart Money Concepts logic, featuring premium Fibonacci zones (50-100%) with infinite extension capability.
リリースノート
Fixed Bearish Order Block calculation issues where it was not properly drawing fibs based on the whole range of the candle, it was only calculating the body.リリースノート
Update:Bearish OB (Red):
50% = Exactly halfway between top (close) and bottom (low)
75% = 25% from bottom (or 75% down from top)
100% = At the bottom wick (low)
All levels are evenly spaced
Bullish OB (Green):
50% = Exactly halfway between bottom (close) and top (high)
75% = 75% from bottom
100% = At the top wick (high)
All levels are evenly spaced
The spacing is now mathematically correct with each level representing the actual percentage of the total candle range
リリースノート
Latest Update - Full Candle Range for Fibonacci Calculations:Problem Identified:
The order blocks were only using partial candle ranges:
Bearish OB: Only body top (close) to bottom wick (low) - missing top wick
Bullish OB: Only top wick (high) to body bottom (close) - missing bottom wick
Solution Implemented:
Both order block types now use the complete candle range from high to low, including both wicks:
Bearish OB: lastBullishCandleHigh (top wick) to lastBullishCandleLow (bottom wick)
Bullish OB: lastBearishCandleHigh (top wick) to lastBearishCandleLow (bottom wick)
Benefits:
More precise Fibonacci level calculations (50%, 75%, 100%) based on entire candle
Consistent spacing between Fibonacci levels
Works correctly even for candles without wicks (doji-like candles)
More accurate representation of the actual institutional order block zone
This ensures the Fibonacci retracements reflect the true price action of the order block candle, making the zones more reliable for trading decisions.
リリースノート
Update: Overlap Prevention SystemWhat was added:
New input setting: "Remove overlapping OBs" (enabled by default)
Automatic detection of overlapping order blocks of the same type
Auto-deletion of older OBs when a newer one overlaps with it
How it works:
When a new order block is created, the indicator checks if it overlaps with any existing order blocks of the same type (bearish with bearish, bullish with bullish). If an overlap is detected, the older OB is automatically deleted before the new one is added.
Benefits:
Cleaner charts when using lower swing bar counts (5-10 bars)
No clutter from multiple OBs stacked on top of each other
Most recent structure is always prioritized and displayed
Toggle control - can be disabled in settings if you want to see all OBs regardless of overlap
Use case:
This is especially useful when analyzing multiple timeframes or using aggressive swing settings, as it prevents the chart from becoming overcrowded while maintaining focus on the most current institutional zones.
オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。