Indicator · Pine Script v6 · Own pane

SMC Session Context

by skipp-dev· code credited to preuss_steffen

This indicator displays session context, market structure shifts, and session scoring in a separate pane using imported pre-generated profile data.

View on GitHub

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

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

SMC_Session_Context_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 session context.

indicator("SMC Session Context", overlay = false, max_labels_count = 50)

import preuss_steffen/smc_micro_profiles_generated/179 as mp

var g_sc = "Session Context"
var bool show_session_label  = input.bool(true,  "Show session label",     group = g_sc)
var bool show_killzone_bg    = input.bool(true,  "Show killzone background", group = g_sc)
var bool show_mss_markers    = input.bool(true,  "Show MSS markers",       group = g_sc)
var bool show_context_score  = input.bool(true,  "Show context score bar", group = g_sc)
var color col_bullish        = input.color(color.new(color.green, 30), "Bullish color",  group = g_sc)
var color col_bearish        = input.color(color.new(color.red, 30),   "Bearish color",  group = g_sc)
var color col_neutral        = input.color(color.new(color.gray, 50),  "Neutral color",  group = g_sc)
var color col_killzone       = input.color(color.new(color.yellow, 85), "Killzone bg",   group = g_sc)

string sc_session       = mp.SESSION_CONTEXT
bool   sc_killzone      = mp.IN_KILLZONE
bool   sc_mss_bull      = mp.SESSION_MSS_BULL
bool   sc_mss_bear      = mp.SESSION_MSS_BEAR
string sc_direction     = mp.SESSION_DIRECTION_BIAS
int    sc_score         = mp.SESSION_CONTEXT_SCORE

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)

color score_color = sc_score >= 4 ? col_bullish : sc_score >= 2 ? col_neutral : col_bearish
plot(show_context_score ? sc_score : na, "Context Score", score_color, 2, plot.style_columns)
hline(3, "Score mid", color.new(color.gray, 70), hline.style_dotted)

bgcolor(show_killzone_bg and sc_killzone ? col_killzone : na, title = "Killzone BG")

plotshape(show_mss_markers and sc_mss_bull ? sc_score : na, "MSS Bull", shape.triangleup, location.bottom, col_bullish, size = size.tiny)
plotshape(show_mss_markers and sc_mss_bear ? sc_score : na, "MSS Bear", shape.triangledown, location.top, col_bearish, size = size.tiny)

var string status_line = ""
if barstate.islast and show_session_label
    status_line := sc_session + " | " + sc_direction + " | Score:" + str.tostring(sc_score)
    label.new(bar_index, sc_score + 0.5, status_line, color = color.new(color.black, 80), textcolor = chart.fg_color, size = size.small, style = label.style_label_down)

Overview

SMC Session Context plots a context score column chart colored by bullish, neutral, or bearish thresholds, highlights active killzones in the background, marks bullish or bearish market structure shifts (MSS), and prints an overview label on the final bar. It also displays a warning badge if the underlying profile snapshot is older than two days.

Details

Published by

skipp-dev on GitHub

Code credit

preuss_steffen, as written in the script's header

Type

Indicator, Pine Script v6

Draws

Separate pane below the chart

Category

SMC / ICT / price action, Sessions & time

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 session labelbooltrueshow_session_label
Show killzone backgroundbooltrueshow_killzone_bg
Show MSS markersbooltrueshow_mss_markers
Show context score barbooltrueshow_context_score
Bullish colorcolorcolor.new(color.green, 30)col_bullish
Bearish colorcolorcolor.new(color.red, 30)col_bearish
Neutral colorcolorcolor.new(color.gray, 50)col_neutral
Killzone bgcolorcolor.new(color.yellow, 85)col_killzone
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

CRT + Turtle Soup Scanner

by alboogycOdR
6 stars

Calculates CRT session range boundaries and detects Turtle Soup setups to identify potential breakout signals. The script tracks session high, low, and midpoint values to determine intraday bias while measuring price break distances against ATR thresholds. It

Indicator v5 SMC / ICT / price actionSessions & time
Updated 7 months ago · None stated GitHub repository of CRT + Turtle Soup Scanner
5 stars

This indicator calculates and plots virtual daily candlestick OHLC values shifted forward by several hours relative to the current time. By aggregating four-hour bar data from higher-timeframe requests, it constructs custom 24-hour periods and renders them as

Indicator v6 Candlestick patternsSessions & time
Updated 7 months ago · MIT GitHub repository of Day Candle Closed Hour(s) Ago

AmiComStrategy

by amico1234
1 stars

AmiComStrategy is an indicator that calculates correlations between securities using the Corell indicator over specified timeframes such as 5D. It filters trading opportunities based on session times like 1300-1700 and security up and down times such as 3H. Th

Indicator v4 Sessions & timeVolatility & bands
Updated 2 years ago · None stated GitHub repository of AmiComStrategy

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
56 stars

This indicator draws ICT killzone boxes on the price chart for Asia, London, New York AM, New York lunch, and New York PM sessions. Each session can be toggled, renamed, and recolored, with optional labels and adjustable box transparency. A session drawing lim

Indicator v5 SMC / ICT / price actionSessions & time
Updated 2 months ago · None stated GitHub repository of ICT Killzones & Pivots [TFO]

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