OPEN-SOURCE SCRIPT
TCT OBIF Detector

█ OVERVIEW
The OBIF (Order Block Imbalance Fill) indicator automatically detects and visualizes high-probability trading zones by combining two powerful Smart Money Concepts: Order Blocks and Fair Value Gaps (FVGs).
An OBIF occurs when an Order Block forms immediately before a Fair Value Gap, creating a zone of institutional interest that price often revisits before continuing its move.
█ CONCEPTS
Order Block (OB)
An Order Block is the last opposing candle before a strong directional move. It represents an area where institutional traders likely placed orders.
- Bullish OB: Last bearish candle before an up-move
- Bearish OB: Last bullish candle before a down-move
Fair Value Gap (FVG)
An FVG is a price imbalance created when a candle's body completely gaps past the previous candle's range, leaving an unfilled area.
- Bullish FVG: Gap up where candle[0].low > candle[2].high
- Bearish FVG: Gap down where candle[0].high < candle[2].low
OBIF Zone
When an Order Block directly precedes an FVG, it creates an OBIF - a confluence zone with higher probability of acting as support/resistance.
█ HOW TO USE
1. Identify the Trend
Use OBIFs in the direction of the higher timeframe trend for best results.
2. Wait for Price to Return
OBIFs act as magnets - price often returns to fill the imbalance and test the order block.
3. Look for Confirmation
When price enters an OBIF zone, look for:
- Rejection wicks
- Engulfing patterns
- Break of structure on lower timeframes
4. Mitigation
Once price fully trades through the OBIF (touches the opposite edge), the zone is considered mitigated and loses its significance.
█ FEATURES
- Automatic Detection — Identifies OBIFs in real-time as they form
- Visual Zones — Clean, non-intrusive boxes that don't obscure price action
- Mitigation Tracking — Zones automatically update when price mitigates them
- Multi-Timeframe Friendly — Works on any timeframe from 1m to Monthly
- Customizable — Adjust colors, opacity, and display preferences
█ SETTINGS
- Lookback Window — How many candles back to search for the Order Block (default: 3)
- Show Bullish/Bearish — Toggle visibility of each type
- Show Mitigated — Display zones that have been mitigated (shown in gray)
- Fill Opacity — Adjust zone transparency (higher = more see-through)
- Border Width — Thickness of zone borders
█ BEST PRACTICES
✓ Use on higher timeframes (1H+) for more reliable zones
✓ Combine with market structure analysis
✓ Look for OBIFs at key support/resistance levels
✓ Use lower timeframe confirmation for entries
✗ Don't trade every OBIF blindly
✗ Avoid OBIFs against the dominant trend
█ CREDITS
The Composite Trader (TCT) methodologies.
The OBIF (Order Block Imbalance Fill) indicator automatically detects and visualizes high-probability trading zones by combining two powerful Smart Money Concepts: Order Blocks and Fair Value Gaps (FVGs).
An OBIF occurs when an Order Block forms immediately before a Fair Value Gap, creating a zone of institutional interest that price often revisits before continuing its move.
█ CONCEPTS
Order Block (OB)
An Order Block is the last opposing candle before a strong directional move. It represents an area where institutional traders likely placed orders.
- Bullish OB: Last bearish candle before an up-move
- Bearish OB: Last bullish candle before a down-move
Fair Value Gap (FVG)
An FVG is a price imbalance created when a candle's body completely gaps past the previous candle's range, leaving an unfilled area.
- Bullish FVG: Gap up where candle[0].low > candle[2].high
- Bearish FVG: Gap down where candle[0].high < candle[2].low
OBIF Zone
When an Order Block directly precedes an FVG, it creates an OBIF - a confluence zone with higher probability of acting as support/resistance.
█ HOW TO USE
1. Identify the Trend
Use OBIFs in the direction of the higher timeframe trend for best results.
2. Wait for Price to Return
OBIFs act as magnets - price often returns to fill the imbalance and test the order block.
3. Look for Confirmation
When price enters an OBIF zone, look for:
- Rejection wicks
- Engulfing patterns
- Break of structure on lower timeframes
4. Mitigation
Once price fully trades through the OBIF (touches the opposite edge), the zone is considered mitigated and loses its significance.
█ FEATURES
- Automatic Detection — Identifies OBIFs in real-time as they form
- Visual Zones — Clean, non-intrusive boxes that don't obscure price action
- Mitigation Tracking — Zones automatically update when price mitigates them
- Multi-Timeframe Friendly — Works on any timeframe from 1m to Monthly
- Customizable — Adjust colors, opacity, and display preferences
█ SETTINGS
- Lookback Window — How many candles back to search for the Order Block (default: 3)
- Show Bullish/Bearish — Toggle visibility of each type
- Show Mitigated — Display zones that have been mitigated (shown in gray)
- Fill Opacity — Adjust zone transparency (higher = more see-through)
- Border Width — Thickness of zone borders
█ BEST PRACTICES
✓ Use on higher timeframes (1H+) for more reliable zones
✓ Combine with market structure analysis
✓ Look for OBIFs at key support/resistance levels
✓ Use lower timeframe confirmation for entries
✗ Don't trade every OBIF blindly
✗ Avoid OBIFs against the dominant trend
█ CREDITS
The Composite Trader (TCT) methodologies.
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน