PROTECTED SOURCE SCRIPT
FVG in Order Blocks Indicator

📊 FVG in Order Blocks — Context-Based Fair Value Gap Analysis
This indicator is designed to study Fair Value Gaps (FVGs) only when they appear within meaningful market structure zones, specifically Order Blocks and Breaker Blocks.
Instead of treating imbalances in isolation, the script focuses on context — highlighting situations where price imbalance and structure align.
The objective is analytical clarity, not prediction.
🧠 Core Idea
Fair Value Gaps often indicate rapid price movement and potential inefficiencies.
Order Blocks and Breaker Blocks are commonly used to represent areas where price previously reacted with strength.
This script combines both concepts by restricting FVG detection to structurally relevant zones, allowing users to observe how imbalance behaves when it forms in areas already defined by market structure.
🔍 How the Indicator Works
The logic follows a clear, step-by-step process:
🧱 1. Market Structure & Zone Detection
Market swings are derived using a ZigZag-based structure model
From these swings, the script identifies:
Bullish & Bearish Order Blocks
Bullish & Bearish Breaker Blocks
These zones define where FVGs are considered relevant
Only gaps forming inside these zones are evaluated further.
⚡ 2. Fair Value Gap Detection
Bullish and bearish FVGs are detected using confirmed candle logic
No future data or lookahead is used
Optional Consequent Encroachment (midpoint) levels can be plotted for reference
This ensures gaps are identified objectively and consistently.
🔗 3. Confluence Validation
A visual signal is evaluated only when:
An FVG forms
The FVG is inside an active Order Block or Breaker Block
This alignment helps users focus on areas where structure and imbalance overlap, rather than every gap on the chart.
📌 Signal Visualization (Informational Only)
Signals are shown as chart markers and are intended for analysis, not automated execution.
🟢 Bullish Condition
Price is inside a bullish Order Block or Breaker Block
A bullish FVG forms within that zone
The gap is confirmed after candle close
🔴 Bearish Condition
Price is inside a bearish Order Block or Breaker Block
A bearish FVG forms within that zone
The gap is confirmed after candle close
🧪 Optional Filters (User-Controlled)
All filters are optional and can be enabled or disabled independently:
📈 Trend Filter
Market Structure bias
EMA-based methods (EMA 50, EMA 200, EMA cross)
⚡ Displacement Filter
Requires momentum before an FVG is accepted
Based on ATR multiples or candle body percentage
📏 Minimum FVG Size Filter
Ignores very small gaps that may represent noise
Size measured using ATR %, ticks, or price value
⏱ Cooldown Filter
Limits how frequently signals can appear
Helps reduce clustering during ranging conditions
🎨 Visual & Layout Options
Order Blocks and Breaker Blocks drawn as colored zones
Fair Value Gaps displayed as shaded areas
Optional Consequent Encroachment lines
Optional EMAs used by trend filters
Optional markers showing when a setup was filtered out
Timeframe presets are included to adjust sensitivity for common intraday charts, while still allowing full manual customization.
🎯 Intended Use
This indicator is intended for:
Studying price imbalance within structure
Learning how FVGs interact with Order Blocks and Breaker Blocks
Manual trade planning and journaling
Backtesting and educational analysis
It can be applied to Forex, Crypto, Indices, Stocks, and Commodities across multiple timeframes.
ℹ️ Important Notes
Signals are non-repainting and based on confirmed bars
The script does not place trades or manage risk
No performance claims are made
Outcomes depend on market conditions and user interpretation
⚠️ Disclaimer
This script is provided for educational and analytical purposes only.
It does not constitute financial, investment, or trading advice.
Trading involves risk, and users should apply appropriate risk management and independent judgment.
This indicator is designed to study Fair Value Gaps (FVGs) only when they appear within meaningful market structure zones, specifically Order Blocks and Breaker Blocks.
Instead of treating imbalances in isolation, the script focuses on context — highlighting situations where price imbalance and structure align.
The objective is analytical clarity, not prediction.
🧠 Core Idea
Fair Value Gaps often indicate rapid price movement and potential inefficiencies.
Order Blocks and Breaker Blocks are commonly used to represent areas where price previously reacted with strength.
This script combines both concepts by restricting FVG detection to structurally relevant zones, allowing users to observe how imbalance behaves when it forms in areas already defined by market structure.
🔍 How the Indicator Works
The logic follows a clear, step-by-step process:
🧱 1. Market Structure & Zone Detection
Market swings are derived using a ZigZag-based structure model
From these swings, the script identifies:
Bullish & Bearish Order Blocks
Bullish & Bearish Breaker Blocks
These zones define where FVGs are considered relevant
Only gaps forming inside these zones are evaluated further.
⚡ 2. Fair Value Gap Detection
Bullish and bearish FVGs are detected using confirmed candle logic
No future data or lookahead is used
Optional Consequent Encroachment (midpoint) levels can be plotted for reference
This ensures gaps are identified objectively and consistently.
🔗 3. Confluence Validation
A visual signal is evaluated only when:
An FVG forms
The FVG is inside an active Order Block or Breaker Block
This alignment helps users focus on areas where structure and imbalance overlap, rather than every gap on the chart.
📌 Signal Visualization (Informational Only)
Signals are shown as chart markers and are intended for analysis, not automated execution.
🟢 Bullish Condition
Price is inside a bullish Order Block or Breaker Block
A bullish FVG forms within that zone
The gap is confirmed after candle close
🔴 Bearish Condition
Price is inside a bearish Order Block or Breaker Block
A bearish FVG forms within that zone
The gap is confirmed after candle close
🧪 Optional Filters (User-Controlled)
All filters are optional and can be enabled or disabled independently:
📈 Trend Filter
Market Structure bias
EMA-based methods (EMA 50, EMA 200, EMA cross)
⚡ Displacement Filter
Requires momentum before an FVG is accepted
Based on ATR multiples or candle body percentage
📏 Minimum FVG Size Filter
Ignores very small gaps that may represent noise
Size measured using ATR %, ticks, or price value
⏱ Cooldown Filter
Limits how frequently signals can appear
Helps reduce clustering during ranging conditions
🎨 Visual & Layout Options
Order Blocks and Breaker Blocks drawn as colored zones
Fair Value Gaps displayed as shaded areas
Optional Consequent Encroachment lines
Optional EMAs used by trend filters
Optional markers showing when a setup was filtered out
Timeframe presets are included to adjust sensitivity for common intraday charts, while still allowing full manual customization.
🎯 Intended Use
This indicator is intended for:
Studying price imbalance within structure
Learning how FVGs interact with Order Blocks and Breaker Blocks
Manual trade planning and journaling
Backtesting and educational analysis
It can be applied to Forex, Crypto, Indices, Stocks, and Commodities across multiple timeframes.
ℹ️ Important Notes
Signals are non-repainting and based on confirmed bars
The script does not place trades or manage risk
No performance claims are made
Outcomes depend on market conditions and user interpretation
⚠️ Disclaimer
This script is provided for educational and analytical purposes only.
It does not constitute financial, investment, or trading advice.
Trading involves risk, and users should apply appropriate risk management and independent judgment.
Korumalı komut dosyası
Bu komut dosyası kapalı kaynak olarak yayınlanmaktadır. Ancak, ücretsiz ve herhangi bir sınırlama olmaksızın kullanabilirsiniz – daha fazla bilgiyi buradan edinebilirsiniz.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.
Korumalı komut dosyası
Bu komut dosyası kapalı kaynak olarak yayınlanmaktadır. Ancak, ücretsiz ve herhangi bir sınırlama olmaksızın kullanabilirsiniz – daha fazla bilgiyi buradan edinebilirsiniz.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.