OPEN-SOURCE SCRIPT
OB

Advanced Order Block & Liquidity Mapping Tool
This open-source script is designed to help traders identify market structure and key liquidity areas using a combination of fractal-based order block detection and dynamic/static liquidity mapping.
Features Overview:
- Detects bullish and bearish order blocks using 3-bar and 5-bar fractal patterns
- Automatic removal of invalidated order blocks when price bodies fully break above/below OB highs/lows
- Fair Value Gap (FVG) validation option to increase signal quality
- Time-based label system for session or bar analysis
- Highly customizable visuals: line styles, label positions, widths, colors, and time offsets
🛠️ Custom Enhancements:
This version introduces a key improvement: order blocks are automatically removed once they are considered invalid, specifically when the body of a future candle breaks through the high or low of the original OB — not just the wick. This enhances the clarity and reliability of the displayed levels by dynamically filtering out broken zones.
🧠 Based on Open Source Work:
This script includes adapted logic from the open-source Orderblocks script by Nephew_Sam_.
The original detection mechanism has been extended with new invalidation logic and improved visual rendering.
Recommended Usage:
Best suited for intraday or swing-trading strategies based on market structure and smart money concepts (SMC). Works well on 5m to 4h timeframes. Inputs are adjustable to suit varying volatility and session preferences.
⚠️ Disclaimer:
This tool is intended for educational and analytical purposes only. It is not financial advice, and no performance or profitability is guaranteed.
// Portions of the order block logic are adapted from the open-source "Orderblocks" script by Nephew_Sam_.
// Original:
// This version adds custom invalidation logic based on body breaches and enhanced cleanup behavior.
This open-source script is designed to help traders identify market structure and key liquidity areas using a combination of fractal-based order block detection and dynamic/static liquidity mapping.
Features Overview:
- Detects bullish and bearish order blocks using 3-bar and 5-bar fractal patterns
- Automatic removal of invalidated order blocks when price bodies fully break above/below OB highs/lows
- Fair Value Gap (FVG) validation option to increase signal quality
- Time-based label system for session or bar analysis
- Highly customizable visuals: line styles, label positions, widths, colors, and time offsets
🛠️ Custom Enhancements:
This version introduces a key improvement: order blocks are automatically removed once they are considered invalid, specifically when the body of a future candle breaks through the high or low of the original OB — not just the wick. This enhances the clarity and reliability of the displayed levels by dynamically filtering out broken zones.
🧠 Based on Open Source Work:
This script includes adapted logic from the open-source Orderblocks script by Nephew_Sam_.
The original detection mechanism has been extended with new invalidation logic and improved visual rendering.
Recommended Usage:
Best suited for intraday or swing-trading strategies based on market structure and smart money concepts (SMC). Works well on 5m to 4h timeframes. Inputs are adjustable to suit varying volatility and session preferences.
⚠️ Disclaimer:
This tool is intended for educational and analytical purposes only. It is not financial advice, and no performance or profitability is guaranteed.
// Portions of the order block logic are adapted from the open-source "Orderblocks" script by Nephew_Sam_.
// Original:

// This version adds custom invalidation logic based on body breaches and enhanced cleanup behavior.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.