Indicator · Pine Script v5 · On the chart

Supply and Demand Zones V4

by mikeyhu70

Draws supply and demand zones on the price chart from engulfing candle patterns, split into two zone types: one where price breaks the zone high or low, and one where only the open is broken.

View on GitHub

GitHub stars1on the repository
Pine versionv5runs as is
Lines of code430
Settings40inputs
LicenceNone stated
Last update6 months ago15 Apr 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

Each type has its own maximum count, and a tolerance margin allows small breaches. Algorithm modes range from looser to strict engulfing, and a setting can flip the fill colours. It highlights areas only and has no entry, exit or stop rules.

Details

Published by

mikeyhu70 on GitHub

Type

Indicator, Pine Script v5

Draws

On the price chart

Category

Support & resistance, Candlestick patterns

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
Auto Max # of Engulfing (Futures and Extended Hours Instrument)?stringAutomode_auto_engulfing
Algo Mode? (III = I & II, IV = Strict Engulfing) stringImode_algo
Theshold of Mode II for Big vs Small Candlefloat1.25mode_algo2_threshold
Max Bar Back (max_bars_back=500)int500maxBarsBack
Max # of Zone (Type I) (conserve last of max_bars_back=500) int25_maxNumberOfEngulfings
Max # of Zone (Type II)int25maxNumberOfEngulfings2
Zone toterance (margin if error)int5tolerance
Type I: broke zone HIGH or LOW by Zone History parameterstring-N1
Type II: broke OPEN only (upper for LOW and lower for HIGH) by Zone History parameter --> RETEST of ZONEstring-N2
Flip Fill Colorboolfalseflipcolor
Flip Fill Neutral Colorboolfalseflipneutralcolor
Long Term Mode (more zone)boolfalsemode_lt
Show all 40 settings
SettingTypeDefaultVariable
Long Term Percent Increase Zoneint50mode_lt_pct
Long Term Percent Increase Invalidationint150mode_invalidation_pct
How many level back to start removal of invalid zone (invalidation)int8_invalidation
How many bar back from current position for zone invalidation (high)int3zonehist_h
How many bar back from current position for zone invalidation (low)int3zonehist_l
Bullish Fill (A) (Type I)color#004d40bullFillcolor
Bullish Fill (B) (Type I)color#166356bullFillcolor2
Bearish Fill (A) (Type I)color#a86161bearFillcolor
Bearish Fill (B) (Type I)color#be7777bearFillcolor2
Bearish Boxcolorcolor.redbearboxcolor
Bullish Boxcolorcolor.greenbullboxcolor
Bull Fill (Type II)color#7DF9FFneutralbullFillcolor
Bear Fill (Type II)color#FC74FDneutralbearFillcolor
Neutral Box (Type II)colorcolor.oliveneutralbullboxcolor
Neutral Box (Type II)colorcolor.grayneutralbearboxcolor
Fill Transparency (A) (Type I)int70filltransp
Fill Transparency (B) (Type I)int50filltranspa
Fill Transparency (A) (Type II)int75filltransp2
Fill Transparency (B) (Type II)int90filltransp2a
Box Transparency (Type I)int85boxtransp
Box Transparency (Type II)int85boxtransp2
Line Width (Type I)int1linewidth
Line Width (Type II)int1linewidth2
S/D Candle Number of bar back to search (Zone Display)int1loopback
S/D Candle Number of bar back to search (Bar Paint)int1loopback2
S/D Candle ratio of Body vs Candle to considerfloat0.25rbody
S/D Candle ratio of Body vs Candle (for reversal bar)float0.60rbody2
S/D Candle threshold to draw zonefloat0.30rbody3
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

[RS]MTF Candle Sticks

by ricardosantos79
261 stars

This indicator overlays up to five higher-timeframe candlestick groups on the price chart. For each enabled timeframe it requests open, high, low, and close and can show up to five candles, offset by a spacing setting. The main inputs set the candle count, the

Indicator v4 Candlestick patternsSupport & resistance Repaints
Updated 4 years ago · None stated GitHub repository of [RS]MTF Candle Sticks

Candlestick Patterns

by harryguiacorn
220 stars

This indicator plots optional candlestick pattern signals on the price chart. It detects engulfing bars, inside bars, HOLP and LOHP, kicker patterns, body-mass extremes, higher highs and lower lows, ATR warnings, and four-bar fractals. Optional pivot marks use

Indicator v5 Candlestick patternsVolatility & bands
Updated 1 year ago · None stated GitHub repository of Candlestick Patterns

Strat Assistant

by rickyzcarroll
90 stars

The Strat Assistant indicator identifies candlestick patterns from the STRAT methodology on the price chart. It detects inside bars, 2-candle directional bars, 3-candle outside bars, and sequences like 212 and 222 for continuations and reversals. Shapes such a

Indicator v4 Candlestick patternsSupport & resistance
Updated 5 years ago · None stated GitHub repository of Strat Assistant
56 stars

This overlay indicator highlights candles with a body smaller than 50% of their total range by coloring them white on the price chart. Simultaneously, it calculates and plots horizontal lines for open prices across multiple higher timeframes, such as daily, we

Indicator v6 Support & resistanceCandlestick patterns Repaints
Updated 2 months ago · None stated GitHub repository of Daily Weekly Monthly Yearly Opens

This Pine Script indicator identifies liquidity sweeps and confirms signals using a close-back candle pattern directly on the price chart. It tracks recent swing highs and lows over a customizable lookback period. A bullish signal forms when a prior bar sweeps

Indicator v6 SMC / ICT / price actionSupport & resistance
Updated 2 months ago · MPL-2.0 GitHub repository of Liquidity Sweep + Close-Back Confirmation

8020 System Indicator

by TamaraKGreen
46 stars

This overlay indicator draws 80/20 price levels and optional 40-point zone bands on the price chart. It marks repairs, cross sections, and forks with optional letter labels, and can highlight confluence when those marks sit near a level. Separate options shade

Indicator v6 Support & resistanceCandlestick patterns
Updated 7 weeks ago · None stated GitHub repository of 8020 System Indicator

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