Indicator · Pine Script v6 · Own pane

SMC HTF Confluence

by skipp-dev· code credited to preuss_steffen

This indicator plots HTF SMC confluence signals in a separate pane.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code101
Settings6inputs
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

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

SMC_HTF_Confluence_v1_snapshot.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

// Archived snapshot-era source. Do not use as live HTF context.

// ─────────────────────────────────────────────────────────────────
// SMC HTF Confluence Overlay — lightweight companion to SMC Core
//
// Visualizes compression/ATR regime + reversal context from v5.1:
//   • ATR regime state (compression → normal → expansion → exhaustion)
//   • Squeeze on/released markers
//   • Reversal context scores (setup / confirm / follow-through)
//   • HTF structure + divergence flags
//
// Reads mp.* fields from the generated micro-profiles library.
// ─────────────────────────────────────────────────────────────────

indicator("SMC HTF Confluence", overlay = false, max_labels_count = 50)

import preuss_steffen/smc_micro_profiles_generated/179 as mp

var g_htf = "HTF Confluence"
var bool show_atr_regime     = input.bool(true,  "Show ATR regime",            group = g_htf)
var bool show_squeeze        = input.bool(true,  "Show squeeze markers",       group = g_htf)
var bool show_reversal       = input.bool(true,  "Show reversal context",      group = g_htf)
var color col_compression    = input.color(color.new(color.blue, 40),   "Compression",  group = g_htf)
var color col_expansion      = input.color(color.new(color.orange, 40), "Expansion",    group = g_htf)
var color col_exhaustion     = input.color(color.new(color.red, 40),    "Exhaustion",   group = g_htf)

bool   sq_on             = mp.SQUEEZE_ON
bool   sq_released       = mp.SQUEEZE_RELEASED
string sq_momentum       = mp.SQUEEZE_MOMENTUM_BIAS
string atr_regime        = mp.ATR_REGIME
float  atr_ratio         = mp.ATR_RATIO

bool   rev_active        = mp.REVERSAL_CONTEXT_ACTIVE
int    rev_setup         = mp.SETUP_SCORE
int    rev_confirm       = mp.CONFIRM_SCORE
int    rev_follow        = mp.FOLLOW_THROUGH_SCORE
bool   htf_struct_ok     = mp.HTF_STRUCTURE_OK
bool   htf_bull_pat      = mp.HTF_BULLISH_PATTERN
bool   htf_bear_pat      = mp.HTF_BEARISH_PATTERN
bool   htf_bull_div      = mp.HTF_BULLISH_DIVERGENCE
bool   htf_bear_div      = mp.HTF_BEARISH_DIVERGENCE
bool   fvg_confirm       = mp.FVG_CONFIRM_OK
bool   vwap_hold         = mp.VWAP_HOLD_OK
bool   retrace_ok        = mp.RETRACE_OK

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)

float atr_plot_val = show_atr_regime ? atr_ratio : na
color atr_color = atr_regime == "COMPRESSION" ? col_compression :
     atr_regime == "EXPANSION"  ? col_expansion  :
     atr_regime == "EXHAUSTION" ? col_exhaustion  :
     color.new(color.gray, 50)
plot(atr_plot_val, "ATR Ratio", atr_color, 2, plot.style_columns)
hline(1.0, "ATR Baseline", color.new(color.gray, 70), hline.style_dotted)

plotshape(show_squeeze and sq_on,       "Squeeze On",       shape.diamond, location.bottom, col_compression, size = size.tiny)
plotshape(show_squeeze and sq_released, "Squeeze Released", shape.circle,  location.bottom, col_expansion,   size = size.tiny)

color momentum_bg = show_squeeze and sq_on ?
     sq_momentum == "BULLISH"  ? color.new(color.green, 92) :
     sq_momentum == "BEARISH"  ? color.new(color.red, 92)   :
     color.new(color.yellow, 94) :
     na
bgcolor(momentum_bg, title = "Squeeze Momentum")

plot(show_reversal and rev_active ? rev_setup   : na, "Setup Score",   color.new(color.blue, 40),   1, plot.style_stepline, display = display.pane)
plot(show_reversal and rev_active ? rev_confirm : na, "Confirm Score", color.new(color.green, 40),  1, plot.style_stepline, display = display.pane)
plot(show_reversal and rev_active ? rev_follow  : na, "Follow Score",  color.new(color.orange, 40), 1, plot.style_stepline, display = display.pane)

plotshape(show_reversal and htf_bull_div, "HTF Bull Divergence", shape.triangleup,   location.bottom, color.new(color.green, 20), size = size.tiny)
plotshape(show_reversal and htf_bear_div, "HTF Bear Divergence", shape.triangledown, location.top,    color.new(color.red, 20),   size = size.tiny)

color rev_bg = show_reversal and rev_active ?
     rev_setup >= 4 and rev_confirm >= 3 ? color.new(color.green, 88) :
     rev_setup >= 3                       ? color.new(color.yellow, 90) :
     color.new(color.gray, 93) :
     na
bgcolor(rev_bg, title = "Reversal Context")

string htf_summary = "ATR:" + atr_regime + " R:" + str.tostring(atr_ratio, "#.##") +
     (sq_on ? " SQ" : "") + (sq_released ? " REL" : "") +
     (rev_active ? " REV:" + str.tostring(rev_setup) + "/" + str.tostring(rev_confirm) + "/" + str.tostring(rev_follow) : "")
plotchar(0, "HTF Summary", "•", location.absolute, size = size.tiny, display = display.status_line, char = htf_summary)

Overview

SMC HTF Confluence visualizes ATR regime states from compression through expansion and exhaustion using custom colors. Squeeze markers indicate on or released states while reversal context displays scores for setup, confirm and follow-through phases. Additional plots include HTF structure flags, bullish and bearish patterns, divergence detections, FVG confirms and VWAP holds. Inputs toggle visibility of ATR regime, squeeze markers and reversal context plus allow color customization. It depends on data from the SMC micro-profiles library. The script is archived as a snapshot and not intended for live use.

Details

Published by

skipp-dev on GitHub

Code credit

preuss_steffen, as written in the script's header

Draws

Separate pane below the 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 ATR regimebooltrueshow_atr_regime
Show squeeze markersbooltrueshow_squeeze
Show reversal contextbooltrueshow_reversal
Compressioncolorcolor.new(color.blue, 40)col_compression
Expansioncolorcolor.new(color.orange, 40)col_expansion
Exhaustioncolorcolor.new(color.red, 40)col_exhaustion
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

330 stars

This indicator plots a TTM Squeeze momentum oscillator and a MACD line in a separate pane. It builds the squeeze oscillator from a linear regression of price against a high-low and simple moving average midpoint, and colors the area by slope and sign. Circles

Indicator v5 Oscillators & momentumVolatility & bands
Updated 2 months ago · None stated GitHub repository of TTM Squeeze + MACD line [Alorse]

Bubbles Indicator

by capissimo
114 stars

The Bubbles Indicator measures volatility squeezes and expansion bursts using Bollinger Bands combined with a sinusoid oscillator and RSI divergence. It processes price data through scaled Bollinger Bands to highlight volatility changes while confirming trend

Indicator v4 Volatility & bandsOscillators & momentum Repaints
Updated 1 year ago · None stated GitHub repository of Bubbles Indicator

TTM Squeeze Divergence

by TamaraKGreen
46 stars

The TTM Squeeze Divergence indicator plots a classic TTM Squeeze momentum oscillator in a separate pane alongside Bollinger Bands and Keltner Channels squeeze status dots on the zero line. It detects regular and hidden bullish and bearish divergences between p

Indicator v6 Oscillators & momentumVolatility & bands Repaints
Updated 8 weeks ago · None stated GitHub repository of TTM Squeeze Divergence

Relative Strength Index

by deepentropy
13 stars

This indicator plots the Relative Strength Index in a separate pane from smoothed up and down price changes. It draws the RSI line with horizontal bands at 70, 50 and 30, plus overbought and oversold gradient fills. Optional settings add a smoothing moving ave

Indicator v6 Oscillators & momentumMoving averages
Updated 6 months ago · MIT GitHub repository of Relative Strength Index

More SMC / ICT 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