Indicator · Pine Script v6 · On the chart

SMC Imbalance Context

by skipp-dev· code credited to preuss_steffen

SMC Imbalance Context is an indicator that overlays FVG zones, BPR zones, liquidity voids, and imbalance state labels on the price chart.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code104
Settings8inputs
LicenceNone statedfile: MPL-2.0
Last update2 days ago26 Oct 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

104 lines of Pine Script v6 from SMC_Imbalance_Context.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

SMC_Imbalance_Context.pine
// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © preuss_steffen

//@version=6

// Product role: companion_operator_only. Pro-only imbalance-context companion outside the Lite default surface.

// ─────────────────────────────────────────────────────────────────
// SMC Imbalance Context Overlay — visualizes v5.3 imbalance lifecycle
//
// Reads Imbalance Lifecycle fields from the generated micro-profiles library:
//   • FVG zones (bull / bear) with mitigation state
//   • BPR (Balanced Price Range) zone
//   • Liquidity voids
//   • Composite IMBALANCE_STATE
//
// Keep on a separate pane or overlay — independent of trade signals.
// ─────────────────────────────────────────────────────────────────

indicator("SMC Imbalance Context", overlay = true, max_boxes_count = 50, max_labels_count = 50)

import preuss_steffen/smc_micro_profiles_generated/569 as mp

// ── Inputs ──────────────────────────────────────────────────────

var g_im = "Imbalance Context"
var bool show_fvg_zones      = input.bool(true,  "Show FVG zones",             group = g_im)
var bool show_bpr_zone       = input.bool(true,  "Show BPR zone",              group = g_im)
var bool show_liq_voids      = input.bool(true,  "Show liquidity voids",       group = g_im)
var bool show_state_label    = input.bool(true,  "Show imbalance state label", group = g_im)
var color col_bull_fvg       = input.color(color.new(color.green, 75), "Bull FVG",      group = g_im)
var color col_bear_fvg       = input.color(color.new(color.red, 75),   "Bear FVG",      group = g_im)
var color col_bpr            = input.color(color.new(color.purple, 80), "BPR zone",     group = g_im)
var color col_liq_void       = input.color(color.new(color.orange, 80), "Liquidity void", group = g_im)

// ── Library fields ──────────────────────────────────────────────

bool   im_bull_fvg        = mp.BULL_FVG_ACTIVE
bool   im_bear_fvg        = mp.BEAR_FVG_ACTIVE
float  im_bull_fvg_top    = mp.BULL_FVG_TOP
float  im_bull_fvg_bot    = mp.BULL_FVG_BOTTOM
float  im_bear_fvg_top    = mp.BEAR_FVG_TOP
float  im_bear_fvg_bot    = mp.BEAR_FVG_BOTTOM
bool   im_bull_partial     = mp.BULL_FVG_PARTIAL_MITIGATION
bool   im_bear_partial     = mp.BEAR_FVG_PARTIAL_MITIGATION
bool   im_bull_full        = mp.BULL_FVG_FULL_MITIGATION
bool   im_bear_full        = mp.BEAR_FVG_FULL_MITIGATION
int    im_bull_count       = mp.BULL_FVG_COUNT
int    im_bear_count       = mp.BEAR_FVG_COUNT
float  im_bull_mit_pct     = mp.BULL_FVG_MITIGATION_PCT
float  im_bear_mit_pct     = mp.BEAR_FVG_MITIGATION_PCT
bool   im_bpr_active       = mp.BPR_ACTIVE
float  im_bpr_top          = mp.BPR_TOP
float  im_bpr_bot          = mp.BPR_BOTTOM
bool   im_lv_bull          = mp.LIQ_VOID_BULL_ACTIVE
bool   im_lv_bear          = mp.LIQ_VOID_BEAR_ACTIVE
float  im_lv_top           = mp.LIQ_VOID_TOP
float  im_lv_bot           = mp.LIQ_VOID_BOTTOM
string im_state            = mp.IMBALANCE_STATE
int    im_fvg_net          = mp.FVG_NET_IMBALANCE

// Library freshness check (shared pattern across all companions)
var label stale_badge = na
if barstate.islast
    float asof_year  = str.tonumber(str.substring(mp.ASOF_DATE, 0, 4))
    float asof_month = str.tonumber(str.substring(mp.ASOF_DATE, 5, 7))
    float asof_day   = str.tonumber(str.substring(mp.ASOF_DATE, 8, 10))
    int asof_ts      = timestamp(int(asof_year), int(asof_month), int(asof_day))
    int days_old     = math.floor((timenow - asof_ts) / 86400000)
    if days_old > 2
        if not na(stale_badge)
            label.delete(stale_badge)
        stale_badge := label.new(bar_index, low,
            "⚠ Library " + str.tostring(days_old) + "d old",
            color = color.new(color.red, 40), textcolor = color.white,
            style = label.style_label_up, size = size.tiny)

// ── FVG zone boxes ──────────────────────────────────────────────

var box bull_fvg_box = na
var box bear_fvg_box = na

if show_fvg_zones and im_bull_fvg and not im_bull_full
    bull_fvg_box := box.new(bar_index - 1, im_bull_fvg_top, bar_index, im_bull_fvg_bot, border_color = col_bull_fvg, bgcolor = col_bull_fvg)
if show_fvg_zones and im_bear_fvg and not im_bear_full
    bear_fvg_box := box.new(bar_index - 1, im_bear_fvg_top, bar_index, im_bear_fvg_bot, border_color = col_bear_fvg, bgcolor = col_bear_fvg)

// ── BPR zone ────────────────────────────────────────────────────

var box bpr_box = na
if show_bpr_zone and im_bpr_active
    bpr_box := box.new(bar_index - 1, im_bpr_top, bar_index, im_bpr_bot, border_color = col_bpr, bgcolor = col_bpr)

// ── Liquidity voids ─────────────────────────────────────────────

var box lv_box = na
if show_liq_voids and (im_lv_bull or im_lv_bear)
    lv_box := box.new(bar_index - 1, im_lv_top, bar_index, im_lv_bot, border_color = col_liq_void, bgcolor = col_liq_void)

// ── Status label ────────────────────────────────────────────────

if barstate.islast and show_state_label
    string detail = im_state + " | FVG=" + str.tostring(im_bull_count) + "/" + str.tostring(im_bear_count) + " | BPR=" + (im_bpr_active ? "ON" : "off")
    label.new(bar_index, high, detail, color = color.new(color.black, 80), textcolor = chart.fg_color, size = size.small, style = label.style_label_down)

Overview

SMC Imbalance Context reads active states and mitigation details for bull and bear FVGs along with BPR and liquidity void data from the skipp-algo micro-profiles library. Users toggle visibility of each element and select custom colors. The overlay provides visual context on imbalance lifecycle states but generates no trade signals or entry-exit rules. Main inputs control display options and coloring. It functions as a companion tool on the price chart with no stop loss or pyramiding.

Details

Published by

skipp-dev on GitHub

Code credit

preuss_steffen, as written in the script's header

Type

Indicator, Pine Script v6

Draws

On the price chart

Category

SMC / ICT / price action, Support & resistance

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Show FVG zonesbooltrueshow_fvg_zones
Show BPR zonebooltrueshow_bpr_zone
Show liquidity voidsbooltrueshow_liq_voids
Show imbalance state labelbooltrueshow_state_label
Bull FVGcolorcolor.new(color.green, 75)col_bull_fvg
Bear FVGcolorcolor.new(color.red, 75)col_bear_fvg
BPR zonecolorcolor.new(color.purple, 80)col_bpr
Liquidity voidcolorcolor.new(color.orange, 80)col_liq_void
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

ICT Equal Highs and Lows

by ArunKBhaskar
575 stars

This overlay indicator finds pivot highs and lows on the price chart and compares the last two highs and the last two lows. When the percentage difference between a pair is below the Equal HL threshold, it treats them as equal levels and draws a box. Left and

Indicator v5 SMC / ICT / price actionSupport & resistance
Updated 1 year ago · MPL-2.0 GitHub repository of ICT Equal Highs and Lows

DE-tracker

by Allen1212
303 stars

This indicator plots labels on the TradingView price chart to mark ARK Invest's buy and sell trades for the DE stock. Buy transactions appear in green with X1 or X2 multipliers showing the number of ARK ETFs involved on the same day; sells appear in red. The m

Indicator v4 Support & resistanceSMC / ICT / price action
Updated 2 years ago · None stated GitHub repository of DE-tracker

This Pine Script indicator plots a ZigZag on the price chart. It identifies reversal points when price moves more than a set percentage from the last pivot. The script calculates forecasts using zigzag data and labels detected geometric patterns including harm

Indicator v4 TrendSupport & resistance

Golden Bullet Strategy

by TradersPost
218 stars

The Golden Bullet Strategy is an overlay signal indicator based on Smart Money Concepts and time-based liquidity models. It identifies liquidity sweeps of a designated reference session range during a specified hunt window. It then confirms Market Structure Sh

Indicator v6 SMC / ICT / price actionSessions & time
Updated 3 months ago · None stated GitHub repository of Golden Bullet Strategy

Open Source Fractal

by cantolab
183 stars

This indicator implements the Fractal Model concept to plot market structure shifts, liquidity sweeps, and Change in State of Delivery (CISD) levels. It overlays custom higher-timeframe candle previews, open prices, and time markers directly on the price chart

Indicator v6 SMC / ICT / price actionSupport & resistance
Updated 2 months ago · MIT GitHub repository of Open Source Fractal

Swing Failure Signals

by Ganador1
154 stars

This indicator calculates pivot highs and pivot lows to detect liquidity sweeps and Swing Failure Patterns. It identifies when price breaks past recent key swing highs or lows within a configurable historical window, then looks for a quick reversal or change i

Indicator v6 SMC / ICT / price actionSupport & resistance
Updated 2 months ago · Apache-2.0 GitHub repository of Swing Failure Signals

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers