PROTECTED SOURCE SCRIPT
DuoBlocks — ICT Order Block Detector

DuoBlocks — ICT Order Block Detector
⚪ Overview
DuoBlocks detects bullish and bearish Order Blocks that form immediately under/over a valid Fair Value Gap. Each zone inherits its height from ATR, so the OB reflects realistic volatility instead of fixed candlestick based values. This makes the zones more adaptive, cleaner, and more faithful to ICT(Inner Circle Trader)-style OB identification.
The indicator displays only the most relevant live block — the one that price is most likely to interact with next.
⚪ Core Logic
DuoBlocks evaluates a two-bar displacement to confirm a real gap (FVG behavior). When a valid upward or downward gap forms, it captures the origin candle as the potential OB and builds the zone using:
• ATR-based height → natural volatility-scaled zone width
• Gap validation above/below price → ensures it’s a true imbalance
• ICT-style logic → the OB sits directly behind the displacement/FVG
• Adaptive time-frame filter → different gap thresholds for <1h and ≥1h charts
• Lookback limit → prevents ancient blocks from cluttering the chart
• Automatic invalidation → block dies if price breaks its boundary
Only surviving blocks remain active, giving a clean and trustworthy supply/demand map.
⚪ Block Selection Engine
When multiple OBs exist, DuoBlocks automatically picks the most relevant:
Bearish OB (supply)
• Must sit above current price
• Chooses the nearest one overhead
• If equal → prefers the newest
• Optional fallback to the closest OB if none sit above price
Bullish OB (demand)
• Must sit below current price
• Chooses the nearest underfoot OB
• If equal → prefers the newest
• Optional fallback enabled in no-OB conditions
⚪ Midline System
Each active OB can show a “midline” at its exact center:
⚪ Inputs & Controls
• ATR length
• Right-side zone extension
• Lookback depth
• Max stored OBs per side
• Optional nearest-fallback
• Toggleable midline + width control
• Custom bull/bear colors
Disclaimer
This script is for educational purposes only and is not financial advice. Trading involves risk, and you are fully responsible for your decisions and results.
⚪ Overview
DuoBlocks detects bullish and bearish Order Blocks that form immediately under/over a valid Fair Value Gap. Each zone inherits its height from ATR, so the OB reflects realistic volatility instead of fixed candlestick based values. This makes the zones more adaptive, cleaner, and more faithful to ICT(Inner Circle Trader)-style OB identification.
The indicator displays only the most relevant live block — the one that price is most likely to interact with next.
⚪ Core Logic
DuoBlocks evaluates a two-bar displacement to confirm a real gap (FVG behavior). When a valid upward or downward gap forms, it captures the origin candle as the potential OB and builds the zone using:
• ATR-based height → natural volatility-scaled zone width
• Gap validation above/below price → ensures it’s a true imbalance
• ICT-style logic → the OB sits directly behind the displacement/FVG
• Adaptive time-frame filter → different gap thresholds for <1h and ≥1h charts
• Lookback limit → prevents ancient blocks from cluttering the chart
• Automatic invalidation → block dies if price breaks its boundary
Only surviving blocks remain active, giving a clean and trustworthy supply/demand map.
⚪ Block Selection Engine
When multiple OBs exist, DuoBlocks automatically picks the most relevant:
Bearish OB (supply)
• Must sit above current price
• Chooses the nearest one overhead
• If equal → prefers the newest
• Optional fallback to the closest OB if none sit above price
Bullish OB (demand)
• Must sit below current price
• Chooses the nearest underfoot OB
• If equal → prefers the newest
• Optional fallback enabled in no-OB conditions
⚪ Midline System
Each active OB can show a “midline” at its exact center:
⚪ Inputs & Controls
• ATR length
• Right-side zone extension
• Lookback depth
• Max stored OBs per side
• Optional nearest-fallback
• Toggleable midline + width control
• Custom bull/bear colors
Disclaimer
This script is for educational purposes only and is not financial advice. Trading involves risk, and you are fully responsible for your decisions and results.
نص برمجي محمي
تم نشر هذا النص البرمجي كمصدر مغلق. ومع ذلك، يمكنك استخدامه بحرية ودون أي قيود - تعرف على المزيد هنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي محمي
تم نشر هذا النص البرمجي كمصدر مغلق. ومع ذلك، يمكنك استخدامه بحرية ودون أي قيود - تعرف على المزيد هنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.