Structural Flow PRO [EXCAVO]

Structure-Driven Order Block and Inefficiency Mapping with Two-Phase OB Lifecycle
The Structural Flow PRO indicator detects market structure shifts and uses them
to generate order blocks and fair value gaps automatically. Unlike implementations
that treat these components independently, this indicator builds them as a causal
chain - structure breaks create order blocks, and the OB lifecycle determines
whether a zone acts as support, resistance, or a polarity flip.
The core difference is the two-phase order block lifecycle: when price first
mitigates an OB, it transforms into a Breaker Block (potential S/R polarity flip)
rather than being removed. Only a second mitigation deletes the zone. This models
how these zones lose relevance over time - not in one touch, but in stages.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ HOW TO USE
Step 1 → Add the indicator. The structure engine immediately begins
detecting pivot highs and lows, drawing BOS and CHoCH labels
as breaks occur.
Step 2 → Note CHoCH events (Change of Character). CHoCH marks the bar
where trend direction flips. BOS (Break of Structure) marks
continuation in the existing direction.
Step 3 → Order blocks mark the origin candle of each structure break.
Each OB zone shows the price range where the break originated.
Step 4 → The OB lifecycle progresses through three stages. Active OB =
untested zone. Breaker (orange border) = mitigated once,
now a potential polarity flip zone. Second mitigation removes
the zone entirely.
Step 5 → Check the dashboard (top right) for current bias, structure
depth, and active zone count. Combine with your own analysis
for confirmation.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ HOW IT CALCULATES
◆ Pivot Detection
The structure engine detects swing highs and lows using a configurable
lookback depth: Short-Term (2 bars), Intermediate (5 bars), or Long-Term
(10 bars). These pivots become the reference levels that define market
structure — the last confirmed swing high is resistance, the last swing
low is support.
◆ Structure Break Classification
On each confirmed bar, the engine checks whether price has exceeded the
last pivot level. The confirmation source depends on settings: body mode
uses the candle close, wick mode uses the high or low. When price exceeds
a pivot high, the break is classified as BOS (Break of Structure) if the
trend was already bullish, or CHoCH (Change of Character) if the trend
was bearish — and vice versa for breaks below pivot lows. CHoCH indicates a
trend reversal; BOS indicates continuation.
◆ Order Block Creation (Triggered by Structure)
Order blocks are not detected independently. When a structure break occurs,
the engine scans backward up to 20 bars to find the last opposing candle
(bearish candle for bullish breaks, bullish candle for bearish breaks).
That candle's open-close range becomes the order block zone. No structure
break means no order block — every OB on the chart exists because a
structure break created it.
◆ Two-Phase OB Lifecycle: Active → Breaker → Removed
When price first penetrates an OB zone (close or wick, configurable), the
OB converts to a Breaker Block instead of being deleted. The border changes
to the signal color and the fill becomes neutral. The Breaker represents
a polarity flip zone — former support becoming resistance, or vice versa.
Only a second penetration removes the zone entirely from the chart.
◆ Fair Value Gap Detection
A bullish FVG forms when the current bar's low exceeds the high from two
bars back (high[2] < low[0]), creating a three-bar gap. A bearish FVG
forms when the current bar's high is below the low from two bars back
(low[2] > high[0]). Each gap extends forward as a box and is auto-removed
when price fills it (close enters the gap range), if the fill option is
enabled.
◆ Component Interaction
The three components form a causal chain, not a stack of independent
detectors. Pivots define structure levels. Structure breaks trigger OB
creation at the origin candle. OBs track their own lifecycle through
mitigation. FVGs mark inefficiencies around these structure-driven events.
The trend state (bullish/bearish) set by structure breaks determines
whether new breaks are classified as continuation or reversal.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ WHAT MAKES IT DIFFERENT
◆ Causal Chain Architecture
Structure breaks, order blocks, and fair value gaps are not three independent
detectors stacked on one chart. The structure engine is the trigger - only when
a pivot high or low is broken does the OB engine activate, scanning back up to
20 bars to find the origin candle. FVGs provide inefficiency context around these
structure-driven zones. Every OB on the chart exists because a structure break
created it.
◆ Two-Phase Order Block Lifecycle
Most order block implementations delete an order block on first touch. This indicator models
a two-stage decay: first mitigation converts the OB into a Breaker Block (border
changes to orange, fill becomes neutral). The Breaker represents the polarity flip
zone - former support becoming resistance, or vice versa. Only a second mitigation
removes the zone entirely. This models how zones decay through multiple tests
rather than a single touch.
◆ Adaptive Pivot Depth
The Structure Level setting controls pivot detection sensitivity with three modes:
Short-Term uses 2-bar lookback for scalping analysis, Intermediate uses 5 bars for
swing trading, and Long-Term uses 10 bars for positional analysis. Deeper pivots
produce fewer but higher-quality structure breaks and consequently fewer, more
significant order blocks.
◆ Non-Repainting Signal Architecture
By default, all structure break signals require bar close confirmation
(barstate.isconfirmed). BOS and CHoCH labels appear only after the bar that
caused the break has closed, preventing intra-bar signal flickering. An optional
"Allow Repainting" toggle enables real-time detection for experienced users who
prefer faster signals with the tradeoff of potential repainting.
◆ Body vs Wick Confirmation
The "Confirm with Body Break" setting determines how structure breaks are validated.
When ON, the candle close must exceed the pivot level - a stricter condition that
filters out wick-only fakeouts. When OFF, any touch (high or low) beyond the level
triggers the break. Body confirmation reduces false signals in choppy markets at
the cost of slightly delayed detection.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ DASHBOARD
Real-time panel (top right) with key metrics:
Legend table (bottom left) explains all abbreviations with color coding.
Toggle both panels in Dashboard settings.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ SETTINGS
Market Structure
Order Blocks
Fair Value Gaps
Visualization
Dashboard
Alerts
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ ALERTS
When JSON Alerts are enabled, the indicator also fires dynamic alert() calls with
JSON payloads on confirmed bars. Each payload includes: action, direction, ticker,
price, timeframe, and indicator tag. Compatible with 3Commas, Alertatron, and
custom webhook bots.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This indicator is published as invite-only. The protected source contains
the two-phase order block lifecycle engine (Active → Breaker → Removed
state machine), the causal chain architecture that links structure breaks
to order block creation, and the adaptive pivot-depth system. These
algorithms represent original methodology that would lose its value if
exposed as open source. The description above provides full transparency
on what the indicator calculates and how.
Best regards,
EXCAVO
The Structural Flow PRO indicator detects market structure shifts and uses them
to generate order blocks and fair value gaps automatically. Unlike implementations
that treat these components independently, this indicator builds them as a causal
chain - structure breaks create order blocks, and the OB lifecycle determines
whether a zone acts as support, resistance, or a polarity flip.
The core difference is the two-phase order block lifecycle: when price first
mitigates an OB, it transforms into a Breaker Block (potential S/R polarity flip)
rather than being removed. Only a second mitigation deletes the zone. This models
how these zones lose relevance over time - not in one touch, but in stages.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ HOW TO USE
Step 1 → Add the indicator. The structure engine immediately begins
detecting pivot highs and lows, drawing BOS and CHoCH labels
as breaks occur.
Step 2 → Note CHoCH events (Change of Character). CHoCH marks the bar
where trend direction flips. BOS (Break of Structure) marks
continuation in the existing direction.
Step 3 → Order blocks mark the origin candle of each structure break.
Each OB zone shows the price range where the break originated.
Step 4 → The OB lifecycle progresses through three stages. Active OB =
untested zone. Breaker (orange border) = mitigated once,
now a potential polarity flip zone. Second mitigation removes
the zone entirely.
Step 5 → Check the dashboard (top right) for current bias, structure
depth, and active zone count. Combine with your own analysis
for confirmation.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ HOW IT CALCULATES
◆ Pivot Detection
The structure engine detects swing highs and lows using a configurable
lookback depth: Short-Term (2 bars), Intermediate (5 bars), or Long-Term
(10 bars). These pivots become the reference levels that define market
structure — the last confirmed swing high is resistance, the last swing
low is support.
◆ Structure Break Classification
On each confirmed bar, the engine checks whether price has exceeded the
last pivot level. The confirmation source depends on settings: body mode
uses the candle close, wick mode uses the high or low. When price exceeds
a pivot high, the break is classified as BOS (Break of Structure) if the
trend was already bullish, or CHoCH (Change of Character) if the trend
was bearish — and vice versa for breaks below pivot lows. CHoCH indicates a
trend reversal; BOS indicates continuation.
◆ Order Block Creation (Triggered by Structure)
Order blocks are not detected independently. When a structure break occurs,
the engine scans backward up to 20 bars to find the last opposing candle
(bearish candle for bullish breaks, bullish candle for bearish breaks).
That candle's open-close range becomes the order block zone. No structure
break means no order block — every OB on the chart exists because a
structure break created it.
◆ Two-Phase OB Lifecycle: Active → Breaker → Removed
When price first penetrates an OB zone (close or wick, configurable), the
OB converts to a Breaker Block instead of being deleted. The border changes
to the signal color and the fill becomes neutral. The Breaker represents
a polarity flip zone — former support becoming resistance, or vice versa.
Only a second penetration removes the zone entirely from the chart.
◆ Fair Value Gap Detection
A bullish FVG forms when the current bar's low exceeds the high from two
bars back (high[2] < low[0]), creating a three-bar gap. A bearish FVG
forms when the current bar's high is below the low from two bars back
(low[2] > high[0]). Each gap extends forward as a box and is auto-removed
when price fills it (close enters the gap range), if the fill option is
enabled.
◆ Component Interaction
The three components form a causal chain, not a stack of independent
detectors. Pivots define structure levels. Structure breaks trigger OB
creation at the origin candle. OBs track their own lifecycle through
mitigation. FVGs mark inefficiencies around these structure-driven events.
The trend state (bullish/bearish) set by structure breaks determines
whether new breaks are classified as continuation or reversal.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ WHAT MAKES IT DIFFERENT
◆ Causal Chain Architecture
Structure breaks, order blocks, and fair value gaps are not three independent
detectors stacked on one chart. The structure engine is the trigger - only when
a pivot high or low is broken does the OB engine activate, scanning back up to
20 bars to find the origin candle. FVGs provide inefficiency context around these
structure-driven zones. Every OB on the chart exists because a structure break
created it.
◆ Two-Phase Order Block Lifecycle
Most order block implementations delete an order block on first touch. This indicator models
a two-stage decay: first mitigation converts the OB into a Breaker Block (border
changes to orange, fill becomes neutral). The Breaker represents the polarity flip
zone - former support becoming resistance, or vice versa. Only a second mitigation
removes the zone entirely. This models how zones decay through multiple tests
rather than a single touch.
◆ Adaptive Pivot Depth
The Structure Level setting controls pivot detection sensitivity with three modes:
Short-Term uses 2-bar lookback for scalping analysis, Intermediate uses 5 bars for
swing trading, and Long-Term uses 10 bars for positional analysis. Deeper pivots
produce fewer but higher-quality structure breaks and consequently fewer, more
significant order blocks.
◆ Non-Repainting Signal Architecture
By default, all structure break signals require bar close confirmation
(barstate.isconfirmed). BOS and CHoCH labels appear only after the bar that
caused the break has closed, preventing intra-bar signal flickering. An optional
"Allow Repainting" toggle enables real-time detection for experienced users who
prefer faster signals with the tradeoff of potential repainting.
◆ Body vs Wick Confirmation
The "Confirm with Body Break" setting determines how structure breaks are validated.
When ON, the candle close must exceed the pivot level - a stricter condition that
filters out wick-only fakeouts. When OFF, any touch (high or low) beyond the level
triggers the break. Body confirmation reduces false signals in choppy markets at
the cost of slightly delayed detection.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ DASHBOARD
Real-time panel (top right) with key metrics:
- Bias - BULLISH / BEARISH / NEUTRAL based on current structure trend
- Depth - active Structure Level (Short-Term / Intermediate / Long-Term)
- OBs - count of active order block zones (including breakers)
- FVGs - count of unfilled fair value gaps (bull + bear combined)
Legend table (bottom left) explains all abbreviations with color coding.
Toggle both panels in Dashboard settings.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ SETTINGS
Market Structure
- Structure Level - Intermediate (pivot lookback: Short-Term 2, Intermediate 5, Long-Term 10 bars)
- Confirm with Body Break - ON (close must cross level; OFF = wick touch sufficient)
- Allow Repainting - OFF (signals on bar close only; ON = real-time with possible repaint)
Order Blocks
- Max OBs per Side - 4 (up to 4 demand OBs below price and 4 supply OBs above price; oldest of each type removed first)
- Mitigation Method - Close (Close = price closes through zone; Wick = shadow touch enough)
Fair Value Gaps
- Show FVGs - ON (toggle gap detection)
- Max FVGs per Side - 4 (up to 4 bull FVGs below price and 4 bear FVGs above price; oldest removed first)
- Remove Filled FVGs - ON (auto-remove when price fills the inefficiency)
Visualization
- Bullish Color - dark blue (color for bullish structures, OBs, and FVGs)
- Bearish Color - dark red (color for bearish structures, OBs, and FVGs)
- Signal Color - orange (color for CHoCH labels, breaker borders, highlights)
- Glass Effect on Zones - ON (semi-transparent fill vs slightly more opaque)
- Show Pivot Markers - OFF (optional markers at raw pivot highs and lows)
Dashboard
- Show Dashboard - ON (bias panel in top-right corner)
- Show Legend - ON (abbreviation table in bottom-left corner)
Alerts
- JSON Alerts (for bots) - OFF (enable JSON payloads for 3Commas, Wunderbit, etc.)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ ALERTS
- Bullish BOS - bullish break of structure (trend continuation upward)
- Bullish CHoCH - bullish change of character (trend reversal to bullish)
- Bearish BOS - bearish break of structure (trend continuation downward)
- Bearish CHoCH - bearish change of character (trend reversal to bearish)
When JSON Alerts are enabled, the indicator also fires dynamic alert() calls with
JSON payloads on confirmed bars. Each payload includes: action, direction, ticker,
price, timeframe, and indicator tag. Compatible with 3Commas, Alertatron, and
custom webhook bots.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This indicator is published as invite-only. The protected source contains
the two-phase order block lifecycle engine (Active → Breaker → Removed
state machine), the causal chain architecture that links structure breaks
to order block creation, and the adaptive pivot-depth system. These
algorithms represent original methodology that would lose its value if
exposed as open source. The description above provides full transparency
on what the indicator calculates and how.
Best regards,
EXCAVO
Disclaimer
Trading involves significant risk. This indicator is a technical analysis tool
and does not constitute financial advice, investment recommendations, or a
guarantee of future results. Past indicator behavior does not guarantee future
performance. Always use proper risk management and your own judgment.
Có sẵn trong Gói trả phí
Chỉ báo này chỉ dành cho người đăng ký EXCAVO PRO: Indicators + My Positions . Tham gia ngay để truy cập chỉ báo này và các tập lệnh khác của EXCAVO.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Có sẵn trong Gói trả phí
Chỉ báo này chỉ dành cho người đăng ký EXCAVO PRO: Indicators + My Positions . Tham gia ngay để truy cập chỉ báo này và các tập lệnh khác của EXCAVO.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.