Indicator · Pine Script v6 · On the chart

Market Structure + Supply/Demand

by TradersPost

This indicator maps market structure and supply and demand zones on the price chart.

View on GitHub

Repaints

GitHub stars218on the repository
Pine versionv6current
Lines of code512
Settings32inputs
LicenceNone stated
Last update3 months ago23 Jul 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  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

The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.

Overview

Market Structure + Supply/Demand marks validated and optional unvalidated swing highs and lows using a pivot length and extra confirmation bars. Consolidation and impulse moves are measured against ATR to create demand and supply boxes that expire or gray out after tests. Long and short signals appear when a zone retest meets a minimum risk-to-reward ratio, with plotted entry, stop, and target lines. Settings control zone count, retest rules, colors, alerts, and an optional dashboard. Unconfirmed swings can change while confirmation bars remain at zero.

Details

Published by

TradersPost on GitHub

Type

Indicator, Pine Script v6

Draws

On the price chart

Category

SMC / ICT / price action, Support & resistance, Volatility & bands, Screeners & dashboards

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

  • Signals can change on the live bar or after it closes (repainting)

Settings

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

SettingTypeDefaultVariable
Pivot Lengthint5pivotLength
Confirmation Barsint0confirmBars
Show Unvalidated SwingsbooltrueshowUnvalidated
Consolidation Barsint3consolidationBars
Consolidation ATR Multiplierfloat0.5consolidationThreshold
Impulse ATR Multiplierfloat1.5impulseThreshold
ATR Lengthint14atrLength
Maximum Active Zonesint10maxZones
Zone Expiry Barsint100zoneExpiry
Allow Multiple RetestsbooltrueallowRetest
First Touch OnlyboolfalsefirstTouchOnly
Minimum R:R Ratiofloat2.5minRR
Show all 32 settings
SettingTypeDefaultVariable
Stop Loss Buffer %float0.1stopLossBuffer
Validated Highcolorcolor.redcolorValidatedHigh
Validated Lowcolorcolor.greencolorValidatedLow
Unvalidated Highcolorcolor.new(color.red, 60)colorUnvalidatedHigh
Unvalidated Lowcolorcolor.new(color.green, 60)colorUnvalidatedLow
Demand Zonecolorcolor.new(color.green, 85)colorDemandZone
Supply Zonecolorcolor.new(color.red, 85)colorSupplyZone
Tested Zonecolorcolor.new(color.gray, 90)colorTestedZone
Long Signalcolorcolor.greencolorLongSignal
Short Signalcolorcolor.redcolorShortSignal
Entry Linecolorcolor.bluecolorEntryLine
Stop Losscolorcolor.redcolorStopLine
Take Profitcolorcolor.greencolorTargetLine
Show DashboardbooltrueshowDashboard
Dashboard Positionstringtop_rightdashPosition
Show Trend BackgroundboolfalseshowTrendBG
Background Transparencyint95bgTransparency
Long Entry AlertbooltruealertOnLong
Short Entry AlertbooltruealertOnShort
Trend Change AlertboolfalsealertOnTrendChange
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

575 stars

This overlay indicator scans a pasted list of symbols for ICT liquidity sweep patterns using prior swing sweeps. The screening method looks back one, two, or three swings and can list long and short signals in a results table with adjustable rows, position, an

Indicator v5 SMC / ICT / price actionScreeners & dashboards
Updated 1 year ago · MPL-2.0 GitHub repository of ICT Liquidity Sweep Pattern Scanner
56 stars

This indicator marks forex trading sessions and opening ranges on the price chart. It can draw Sydney, Tokyo, Frankfurt, London, and New York session boxes or five- and fifteen-minute opening ranges, plus an optional opening channel and a day-open range. Day r

Indicator v5 Sessions & timeSupport & resistance Repaints
Updated 2 months ago · None stated GitHub repository of Day Trading Booster by DGT
55 stars

This Pine Script indicator overlays institutional liquidity levels on the price chart. It identifies order block levels using pivot highs and lows, then draws mean reversion lines from the 20 and 50 period simple moving averages, a volatility range midpoint pr

Indicator v6 Support & resistanceSMC / ICT / price action Repaints
Updated 6 months ago · Apache-2.0 GitHub repository of AAPL Institutional Liquidity Grid
53 stars

Apex Trend & Liquidity Master calculates a trend cloud using customizable moving averages expanded by a volatility multiplier directly on the main price chart. It identifies dynamic support and resistance liquidity zones from swing high and low pivots, extendi

Indicator v6 TrendSupport & resistance
Updated 2 months ago · MPL-2.0 GitHub repository of Apex Trend & Liquidity Master

ADR levels

by TamaraKGreen
46 stars

This indicator plots average daily range levels on the price chart, together with optional standard-deviation and Fibonacci levels scaled from that range. Users set the lookback in days, a scale factor, and the visibility, color, and line style of the ADR line

Indicator v5 Support & resistanceVolatility & bands
Updated 7 weeks ago · None stated GitHub repository of ADR levels

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