Indicator · Pine Script v6 · On the chart

SMC Liquidity Context

by skipp-dev· code credited to preuss_steffen

This indicator overlays smart money liquidity analytics directly onto the price chart by reading imported micro-profile data.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code125
Settings5inputs
LicenceNone statedfile: MPL-2.0
Last update4 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

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

SMC_Liquidity_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 liquidity-context companion outside the Lite default surface.

// ─────────────────────────────────────────────────────────────────
// SMC Liquidity Context Overlay — lightweight companion to SMC Core
//
// Visualizes zone intelligence fields from the v5.1 enrichment layer:
//   • Primary support/resistance levels as horizontal rays
//   • Zone strength badges
//   • Zone bias context (support-heavy / resistance-heavy / neutral)
//   • Sweep + mitigation counts
//
// Reads mp.* fields from the generated micro-profiles library.
// ─────────────────────────────────────────────────────────────────

indicator("SMC Liquidity Context", overlay = true, max_labels_count = 50, max_lines_count = 50)

import preuss_steffen/smc_micro_profiles_generated/569 as mp

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

var g_zn = "Zone Context"
var bool show_primary_levels  = input.bool(true,  "Show primary S/R levels",    group = g_zn)
var bool show_zone_label      = input.bool(true,  "Show zone context label",    group = g_zn)
var bool show_sweep_markers   = input.bool(true,  "Show sweep/mitigation info", group = g_zn)
var color col_support         = input.color(color.new(color.green, 30), "Support color",    group = g_zn)
var color col_resistance      = input.color(color.new(color.red, 30),   "Resistance color", group = g_zn)

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

int    zn_support_cnt       = mp.ACTIVE_SUPPORT_COUNT
int    zn_resist_cnt        = mp.ACTIVE_RESISTANCE_COUNT
int    zn_active_cnt        = mp.ACTIVE_ZONE_COUNT
float  zn_support_level     = mp.PRIMARY_SUPPORT_LEVEL
float  zn_resist_level      = mp.PRIMARY_RESISTANCE_LEVEL
int    zn_support_strength  = mp.PRIMARY_SUPPORT_STRENGTH
int    zn_resist_strength   = mp.PRIMARY_RESISTANCE_STRENGTH
int    zn_support_sweeps    = mp.SUPPORT_SWEEP_COUNT
int    zn_resist_sweeps     = mp.RESISTANCE_SWEEP_COUNT
float  zn_support_mitig     = mp.SUPPORT_MITIGATION_PCT
float  zn_resist_mitig      = mp.RESISTANCE_MITIGATION_PCT
string zn_context_bias      = mp.ZONE_CONTEXT_BIAS
float  zn_liq_imbalance     = mp.ZONE_LIQUIDITY_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)

// ── Primary support/resistance lines ────────────────────────────

var line ln_support  = na
var line ln_resist   = na
var label lbl_support = na
var label lbl_resist  = na

if barstate.islast and show_primary_levels
    // Support level
    if zn_support_level > 0.0
        if not na(ln_support)
            line.delete(ln_support)
        if not na(lbl_support)
            label.delete(lbl_support)
        ln_support := line.new(bar_index - 20, zn_support_level, bar_index + 10, zn_support_level,
             xloc.bar_index, extend.none, col_support, line.style_solid, 2)
        lbl_support := label.new(bar_index + 11, zn_support_level,
             "S " + str.tostring(zn_support_level, format.mintick) + " [" + str.tostring(zn_support_strength) + "]",
             xloc.bar_index, yloc.price, col_support, label.style_label_left,
             color.white, size.small)

    // Resistance level
    if zn_resist_level > 0.0
        if not na(ln_resist)
            line.delete(ln_resist)
        if not na(lbl_resist)
            label.delete(lbl_resist)
        ln_resist := line.new(bar_index - 20, zn_resist_level, bar_index + 10, zn_resist_level,
             xloc.bar_index, extend.none, col_resistance, line.style_solid, 2)
        lbl_resist := label.new(bar_index + 11, zn_resist_level,
             "R " + str.tostring(zn_resist_level, format.mintick) + " [" + str.tostring(zn_resist_strength) + "]",
             xloc.bar_index, yloc.price, col_resistance, label.style_label_left,
             color.white, size.small)

// ── Zone context label ──────────────────────────────────────────

var label lbl_context = na
if barstate.islast and show_zone_label
    if not na(lbl_context)
        label.delete(lbl_context)

    string bias_icon = zn_context_bias == "SUPPORT_HEAVY" ? "🟢" :
         zn_context_bias == "RESISTANCE_HEAVY" ? "🔴" : "⚪"
    string ctx_text = bias_icon + " " + zn_context_bias +
         "\nZones: " + str.tostring(zn_active_cnt) +
         " (S:" + str.tostring(zn_support_cnt) + " R:" + str.tostring(zn_resist_cnt) + ")" +
         "\nSweeps: S:" + str.tostring(zn_support_sweeps) + " R:" + str.tostring(zn_resist_sweeps) +
         "\nMitig: S:" + str.tostring(zn_support_mitig, "#.#") + "% R:" + str.tostring(zn_resist_mitig, "#.#") + "%"

    color ctx_color = zn_context_bias == "SUPPORT_HEAVY" ? color.new(color.green, 20) :
         zn_context_bias == "RESISTANCE_HEAVY" ? color.new(color.red, 20) :
         color.new(color.gray, 20)

    lbl_context := label.new(bar_index + 15, close,
         ctx_text, xloc.bar_index, yloc.price,
         ctx_color, label.style_label_left, color.white, size.small)

// ── Status line ─────────────────────────────────────────────────

string zone_summary = zn_context_bias + " Z:" + str.tostring(zn_active_cnt) + " Imb:" + str.tostring(zn_liq_imbalance, "#.##")
plotchar(0, "Zone Summary", "•", location.absolute, size = size.tiny, display = display.status_line, char = zone_summary)

Overview

SMC Liquidity Context displays primary support and resistance levels, zone strength badges, context bias metrics, and sweep or mitigation markers. User inputs control the visibility of levels, zone labels, sweep indicators, and custom zone colors. The script functions solely as an informational companion overlay, providing no automated trading signals or execution, and it depends on an external pre-calculated library that can become outdated if not refreshed.

Details

Published by

skipp-dev on GitHub

Code credit

preuss_steffen, as written in the script's header

Draws

On the price chart

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 primary S/R levelsbooltrueshow_primary_levels
Show zone context labelbooltrueshow_zone_label
Show sweep/mitigation infobooltrueshow_sweep_markers
Support colorcolorcolor.new(color.green, 30)col_support
Resistance colorcolorcolor.new(color.red, 30)col_resistance
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
228 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 Support & resistance scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

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

Compare brokers