OPEN-SOURCE SCRIPT
Orderflow Gap

This is the **Orderflow Gap (OG)** analyzer.
It goes beyond standard price gap detection by integrating
**Market Structure (Dow/SMC)** and **Intra-Bar Orderflow**
to classify the quality and intent behind price discontinuities.
Key Features:
1. **Advanced Gap Detection & Lifecycle:**
- **Flexible Definition:** Users can define gaps based on
market psychology:
- **Body (Open-Close):** Focuses on the "True Gap" between
sessions or candles, ignoring wicks.
- **Full (High-Low):** Focuses on total price dislocation
where no trading occurred at all.
- **Lifecycle Tracking:** The indicator persistently tracks
open gaps and visually marks them as **Filled** once price
mitigates the area by a user-defined percentage.
2. **Intra-Bar Orderflow Profiling (Pre & Post Analysis):**
- **Context:** Standard tools treat a gap merely as empty price space.
This indicator analyzes the **Micro-Auction** immediately surrounding
the event to understand the mechanics of the move.
- **Reconstruction:** Using high-resolution lower timeframe data, it
builds detailed Volume Profiles for the **Pre-Gap Candle** (The Origin)
and the **Post-Gap Candle** (The Reaction).
- **Flow Validation:** This allows the user to verify **Orderflow Continuity**:
Does the aggressive buying/selling that caused the gap continue
immediately after, or is the move fading into absorption?
3. **Statistical Volume Profile Engine:** For each bar in the anchored
period, the indicator builds a complete volume profile on a lower
'Intra-Bar Timeframe'. Instead of simple tick counting, it uses
**statistical models ('PDF' allocation)** to distribute volume
across price levels and **advanced classifiers ('Dynamic' split)**
to determine the buy/sell pressure within that profile.
4. **Structural & Volumetric Context:**
- **Vacuum (Density):** Calculates the "Volume Density" per
tick. A low density indicates a **Liquidity Vacuum** (price
slipped due to lack of orders), while high density indicates
aggressive fighting.
- **Commitment:** Compares the volume surrounding the gap
to the historical average to determine if big players
are backing the move.
- **Trend Alignment:** Filters signals based on the underlying
trend using either **Dow Theory** or **Smart Money Concepts**.
5. **Gap Classification Engine:**
The indicator automatically classifies gaps into four
structural types based on the metrics above:
- **Breakaway:** A high-conviction move that breaks structure,
showing **Initiative** (breaking previous Value Area) and
**Commitment** (High Volume).
- **Runaway:** A continuation gap within an established trend,
aligned with the Orderflow Delta.
- **Exhaustion:** A gap that occurs late in a trend, often
characterized by a **Liquidity Vacuum** (low density) despite
high volume, signaling potential reversal.
- **Common:** Standard volatility gaps lacking significant structural
or volumetric backing.
**Volume Fallback:** If no volume data is provided by the
exchange (e.g., certain CFDs or Indices), the classification
logic automatically defaults to **Common** to ensure strict
signal integrity without Orderflow verification.
6. **Visual Orderflow Insight:**
- **Profile Visualization:** Plots the reconstructed volume
profile as a polyline directly adjacent to the gap, allowing
you to see the "Injection" of volume that caused the move.
- **Color Coding:** Gaps are color-coded based on their
classification (Breakaway/Runaway/Exhaustion) and direction
(Bullish/Bearish).
7. **Multi-Metric Profiling (Volume, Time, Velocity):** Unlike standard
tools, this indicator allows you to switch between three critical
dimensions of market activity:
- **VOLUME (The "Where"):** Shows standard acceptance levels.
- **TIME (The "How Long"):** Measures duration at price (similar to TPO),
indicating fair value (High Time) or rejection (Low Time).
- **VELOCITY (The "How Fast"):** Measures the speed of trading (Contracts
per Second) to reveal intent. **High Velocity** suggests aggression
(initiative buying/selling), while **Low Velocity** despite volume
indicates absorption (passive limit orders).
8. **Integrated Alerts:** Includes granular alerts for:
- Detection of specific gap types (e.g., "Bullish Breakaway Gap").
- General gap formation.
**Caution: Real-Time Data Behavior (Intra-Bar Repainting)**
This indicator uses high-resolution intra-bar data. As a result, the
values on the **current, unclosed bar** (the real-time bar) will
update dynamically as new intra-bar data arrives. This includes
the values used for real-time alerts in 'Structure' and
'Delta' modes.
---
**DISCLAIMER**
1. **For Informational/Educational Use Only:** This indicator is
provided for informational and educational purposes only. It does
not constitute financial, investment, or trading advice, nor is
it a recommendation to buy or sell any asset.
2. **Use at Your Own Risk:** All trading decisions you make based on
the information or signals generated by this indicator are made
solely at your own risk.
3. **No Guarantee of Performance:** Past performance is not an
indicator of future results. The author makes no guarantee
regarding the accuracy of the signals or future profitability.
4. **No Liability:** The author shall not be held liable for any
financial losses or damages incurred directly or indirectly from
the use of this indicator.
5. **Signals Are Not Recommendations:** The alerts and visual signals
(e.g., crossovers) generated by this tool are not direct
recommendations to buy or sell. They are technical observations
for your own analysis and consideration.
It goes beyond standard price gap detection by integrating
**Market Structure (Dow/SMC)** and **Intra-Bar Orderflow**
to classify the quality and intent behind price discontinuities.
Key Features:
1. **Advanced Gap Detection & Lifecycle:**
- **Flexible Definition:** Users can define gaps based on
market psychology:
- **Body (Open-Close):** Focuses on the "True Gap" between
sessions or candles, ignoring wicks.
- **Full (High-Low):** Focuses on total price dislocation
where no trading occurred at all.
- **Lifecycle Tracking:** The indicator persistently tracks
open gaps and visually marks them as **Filled** once price
mitigates the area by a user-defined percentage.
2. **Intra-Bar Orderflow Profiling (Pre & Post Analysis):**
- **Context:** Standard tools treat a gap merely as empty price space.
This indicator analyzes the **Micro-Auction** immediately surrounding
the event to understand the mechanics of the move.
- **Reconstruction:** Using high-resolution lower timeframe data, it
builds detailed Volume Profiles for the **Pre-Gap Candle** (The Origin)
and the **Post-Gap Candle** (The Reaction).
- **Flow Validation:** This allows the user to verify **Orderflow Continuity**:
Does the aggressive buying/selling that caused the gap continue
immediately after, or is the move fading into absorption?
3. **Statistical Volume Profile Engine:** For each bar in the anchored
period, the indicator builds a complete volume profile on a lower
'Intra-Bar Timeframe'. Instead of simple tick counting, it uses
**statistical models ('PDF' allocation)** to distribute volume
across price levels and **advanced classifiers ('Dynamic' split)**
to determine the buy/sell pressure within that profile.
4. **Structural & Volumetric Context:**
- **Vacuum (Density):** Calculates the "Volume Density" per
tick. A low density indicates a **Liquidity Vacuum** (price
slipped due to lack of orders), while high density indicates
aggressive fighting.
- **Commitment:** Compares the volume surrounding the gap
to the historical average to determine if big players
are backing the move.
- **Trend Alignment:** Filters signals based on the underlying
trend using either **Dow Theory** or **Smart Money Concepts**.
5. **Gap Classification Engine:**
The indicator automatically classifies gaps into four
structural types based on the metrics above:
- **Breakaway:** A high-conviction move that breaks structure,
showing **Initiative** (breaking previous Value Area) and
**Commitment** (High Volume).
- **Runaway:** A continuation gap within an established trend,
aligned with the Orderflow Delta.
- **Exhaustion:** A gap that occurs late in a trend, often
characterized by a **Liquidity Vacuum** (low density) despite
high volume, signaling potential reversal.
- **Common:** Standard volatility gaps lacking significant structural
or volumetric backing.
**Volume Fallback:** If no volume data is provided by the
exchange (e.g., certain CFDs or Indices), the classification
logic automatically defaults to **Common** to ensure strict
signal integrity without Orderflow verification.
6. **Visual Orderflow Insight:**
- **Profile Visualization:** Plots the reconstructed volume
profile as a polyline directly adjacent to the gap, allowing
you to see the "Injection" of volume that caused the move.
- **Color Coding:** Gaps are color-coded based on their
classification (Breakaway/Runaway/Exhaustion) and direction
(Bullish/Bearish).
7. **Multi-Metric Profiling (Volume, Time, Velocity):** Unlike standard
tools, this indicator allows you to switch between three critical
dimensions of market activity:
- **VOLUME (The "Where"):** Shows standard acceptance levels.
- **TIME (The "How Long"):** Measures duration at price (similar to TPO),
indicating fair value (High Time) or rejection (Low Time).
- **VELOCITY (The "How Fast"):** Measures the speed of trading (Contracts
per Second) to reveal intent. **High Velocity** suggests aggression
(initiative buying/selling), while **Low Velocity** despite volume
indicates absorption (passive limit orders).
8. **Integrated Alerts:** Includes granular alerts for:
- Detection of specific gap types (e.g., "Bullish Breakaway Gap").
- General gap formation.
**Caution: Real-Time Data Behavior (Intra-Bar Repainting)**
This indicator uses high-resolution intra-bar data. As a result, the
values on the **current, unclosed bar** (the real-time bar) will
update dynamically as new intra-bar data arrives. This includes
the values used for real-time alerts in 'Structure' and
'Delta' modes.
---
**DISCLAIMER**
1. **For Informational/Educational Use Only:** This indicator is
provided for informational and educational purposes only. It does
not constitute financial, investment, or trading advice, nor is
it a recommendation to buy or sell any asset.
2. **Use at Your Own Risk:** All trading decisions you make based on
the information or signals generated by this indicator are made
solely at your own risk.
3. **No Guarantee of Performance:** Past performance is not an
indicator of future results. The author makes no guarantee
regarding the accuracy of the signals or future profitability.
4. **No Liability:** The author shall not be held liable for any
financial losses or damages incurred directly or indirectly from
the use of this indicator.
5. **Signals Are Not Recommendations:** The alerts and visual signals
(e.g., crossovers) generated by this tool are not direct
recommendations to buy or sell. They are technical observations
for your own analysis and consideration.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.