SMC Structure Flow
A reference for the current Pine v6 build: structure, liquidity areas, settings and alert behaviour.
About the indicator
Two independent pivot layers follow internal and swing structure. The overlay combines BOS and CHoCH levels with optional order blocks, equal highs and lows, fair value gaps and previous-period references. The dashboard summarises the current state. This build contains no volume-profile module.
Structure and confirmation
A close beyond an unused confirmed pivot creates a structure event on a closed bar. A break against the previous direction is CHoCH; other breaks are labelled BOS. Internal pivots default to 5 confirmation bars and swing pivots to 50. A pivot is known after those bars, even when its label is drawn at the earlier pivot location.
Each layer has its own event selection and label size. Nearby internal and swing events can produce separate labels. Disable either layer to focus on the other. The optional internal directional body filter requires a bullish body for upward breaks and a bearish body for downward breaks.
Order blocks and liquidity
Order-block candidates come from eligible opposing candles within the configured search range. Range filtering uses ATR or mean candle range. Wick or Close determines invalidation; retention limits keep the chart manageable. Internal blocks default on and swing blocks off, with five retained per layer.
Equal highs and lows use confirmed pivots and an ATR tolerance, defaulting to 3 bars and 0.1 ATR. These are potential liquidity references, not proof of resting orders. Strong and weak levels describe structural direction.
Gaps and reference levels
Optional fair value gaps use completed source-timeframe values. Choose the chart timeframe or a higher timeframe; lower timeframes are not supported. Small-gap filtering defaults to 0.15 ATR, gap transparency to 70 and retained gaps to 30.
Previous day, week and month high/low references are optional. Premium, equilibrium and discount areas provide range context; they do not establish fair value or guarantee reversal.
All settings
These labels, defaults, limits and options are extracted from the current downloadable script.
| Group / setting | Default | Options / limits |
|---|---|---|
| Appearance Structure history | History | History, Latest |
| Appearance Palette | Color | Color, Monochrome |
| Appearance Bullish | #38B99A | color |
| Appearance Bearish | #ED7885 | color |
| Appearance Reference levels | #729CEF | color |
| Appearance Regime candle colors | false | bool |
| Internal structure Internal structure | true | bool |
| Internal structure Pivot confirmation bars | 5 | 2 – 50 |
| Internal structure Bullish events | All | All, BOS, CHoCH |
| Internal structure Bearish events | All | All, BOS, CHoCH |
| Internal structure Directional body filter | false | bool |
| Internal structure Label size | Tiny | Tiny, Small, Normal |
| Swing structure Swing structure | true | bool |
| Swing structure Pivot confirmation bars | 50 | 5 – 200 |
| Swing structure Bullish events | All | All, BOS, CHoCH |
| Swing structure Bearish events | All | All, BOS, CHoCH |
| Swing structure Label size | Small | Tiny, Small, Normal |
| Swing structure HH / LH / HL / LL labels | false | bool |
| Swing structure Strong / weak levels | true | bool |
| Appearance Events retained per layer | 90 | 5 – 150 |
| Order blocks Internal order blocks | true | bool |
| Order blocks Retain | 5 | 1 – 20 |
| Order blocks Swing order blocks | false | bool |
| Order blocks Retain | 5 | 1 – 20 |
| Order blocks Maximum candidate search | 120 | 5 – 500 |
| Order blocks Range filter | ATR | ATR, Mean candle range |
| Order blocks Maximum candle range multiple | 2.0 | 0.5 |
| Order blocks Invalidate using | Wick | Wick, Close |
| Order blocks Fill transparency | 80 | 0 – 100 |
| Order blocks Internal bullish | #729CEF | color |
| Order blocks Internal bearish | #ED8993 | color |
| Order blocks Swing bullish | #567ED5 | color |
| Order blocks Swing bearish | #C76776 | color |
| Liquidity levels Equal highs / lows | true | bool |
| Liquidity levels Pivot confirmation bars | 3 | 1 – 50 |
| Liquidity levels Tolerance in ATR | 0.1 | 0 – 1 |
| Fair value gaps Fair value gaps | false | bool |
| Fair value gaps Timeframe | timeframe | |
| Fair value gaps Filter small gaps | true | bool |
| Fair value gaps Minimum gap in ATR | 0.15 | 0 |
| Fair value gaps Extend in source bars | 1 | 0 – 50 |
| Fair value gaps Gaps retained | 30 | 1 – 50 |
| Fair value gaps Fill transparency | 70 | 0 – 100 |
| Fair value gaps Bullish gap | #52C6A8 | color |
| Fair value gaps Bearish gap | #F08C98 | color |
| Period levels Previous day high / low | false | bool |
| Period levels Previous week high / low | false | bool |
| Period levels Previous month high / low | false | bool |
| Period levels Line style | Dashed | Solid, Dashed, Dotted |
| Value areas Premium / equilibrium / discount | false | bool |
| Value areas Fill transparency | 85 | 0 – 100 |
| Dashboard Dashboard | true | bool |
| Dashboard Position | Top Right | Top Right, Top Left, Bottom Right, Bottom Left |
Installation and alerts
- Open Source code and copy the full script, or download the Pine file.
- In TradingView Pine Editor, paste the code into a new indicator, Save and Add to chart.
- Review the settings for your symbol and timeframe. Remove old instances if saved colours override new defaults.
- Create the desired alert condition and choose Once Per Bar Close.
The script exposes 16 conditions: internal and swing bullish/bearish BOS and CHoCH, four block-invalidation events, equal highs/lows and bullish/bearish gaps. The Vela preview calculates the default internal/swing structure, equal levels and internal order blocks through a native renderer. It is not a Pine runtime; optional Pine modules and alert execution remain available in TradingView. Full TradingView compilation remains unverified.
Reading the chart responsibly
Confirmation adds delay. Historical labels at a pivot origin must not be interpreted as signals available on that earlier candle. Feed, symbol, timeframe, settings and loaded history can change results. Drawings are subject to retention and platform limits.
Structure events and zones provide context, not guaranteed entries or returns. Test on your chosen market before relying on alerts. The downloadable current build includes its MIT licence; retain its notice when redistributing it.

