INDICATOR MANUAL
Supply and demand zones indicatorSupply & Demand Zones - Zone Forge [AFD] · full manual · published to TradingView
Find supply and demand zones from a tight base and a decisive departure, then read how each zone was built from its glow and fill rather than from a label.
Start here
What the indicator does, the questions it can help answer, and its fresh-install defaults.
A zone needs two completed halves. A base is a run of bars whose entire height fits inside Base tightness × ATR(14), and a departure is a bar that closes beyond that base by at least Departure strength × ATR(14). The close is what counts, never the high or the low, so a spike that closes back inside the base creates nothing. The zone appears on the bar that closes the departure, not before.
Each zone is scored once, on the bar that creates it, from the two ratios detection already computed: the departure distance over the distance it had to clear, divided by the base height over its allowed height with a floor of 0.50. Clearing both requirements exactly scores 1.0. Fixed thresholds on that score place the zone in the Weak, Standard, or Strong tier, and the tier is expressed as glow and fill depth instead of a printed rank.
The lifecycle runs one way. A fresh zone is one price has not returned to; a tested zone is one price traded into and did not close through; a broken zone is one price closed through. A broken zone never returns to fresh, and each test after the first steps a zone further back until a fixed wear limit holds it there.
Fresh-install defaults8 documented defaults
Swipe or scroll horizontally to see every column.
| Area | Default | Result |
|---|---|---|
| Preset & theme | Signature · Signature theme · 100 master opacity | Draws the glow default with the shipped palette and no global fade. |
| Detection style | Intraday | Sets base length, tightness, and departure strength together; the three Custom knobs stay inactive. |
| Zone geometry | Wick | Bounds each zone with the base’s highest high and lowest low rather than its open/close extremes. |
| Patterns | All four on | Creates rally-base-drop and drop-base-drop as supply, drop-base-rally and rally-base-rally as demand. |
| Lifecycle rules | Close through · Wick touch | Requires a close beyond a zone to break it and a wick touch to test it. |
| Zone visibility | Tested shown · Broken hidden · 10 per side | Keeps up to ten live zones per side; broken zones stay off because showing them roughly triples what is drawn. |
| Grading | On · emphasis 80 | Scores each zone at creation, with enough emphasis to keep all three tiers on distinct halo stacks. |
| Edge lines and labels | Proximal and distal on · 50% line off · labels on | Draws both zone edges and a type label; the midpoint mitigation line stays off to keep the default chart quiet. |
How it works
How the indicator turns chart data into the states and drawings you see.
Both halves must complete
A zone is created from a finished base and a finished departure. Nothing is drawn while either half is still forming, and a zone appears on the bar that closes the departure. Detection also needs ATR(14) to exist, so the opening bars of a chart produce nothing.
A long tight run is rejected, not trimmed
A tight run longer than Base max length is read as a range and draws nothing. It is not shortened to its last few bars and admitted anyway, which is why loosening Base tightness past the middle of its range draws fewer zones rather than more.
The departure uses the previous bar’s ATR
The threshold a departure bar must clear is measured against the prior bar’s ATR(14), so the departure bar’s own range cannot inflate the requirement it is being tested against.
The grade is frozen at creation
The score is computed once, on the bar that creates the zone, and is never recomputed. A zone already on the chart does not restyle itself later. Grade emphasis changes how far apart the three tiers look, never which tier a zone is in.
Wear is separate from the grade
The grade describes construction and stays fixed. Wear describes what has happened since: each test after the first takes a further percentage off both fill and glow, stopping after four extra tests. Neither fill nor glow ever dims to invisible.
Break beats test on the same bar
When a bar would both test and break a zone, the break is applied. The lifecycle only ever runs one way, so a zone that has broken cannot return to tested or fresh.
Flipping creates a new zone
Flip broken zones, off by default, draws a fresh zone of the opposite type at the same levels when a zone breaks. The broken zone stays broken and nothing already drawn changes what it claims to be. A flip is graded on the bar that broke through and never flips a second time.
The chart is bounded on purpose
A cap per side, a maximum zone age, hidden broken zones, and an overlap rule that will not admit a new zone sitting on a live one all keep the drawing count inside the declared budget of 500 boxes, 500 lines, and 100 labels.
Output and state reference6 documented states
Swipe or scroll horizontally to see every column.
| Output or state | When it appears | Meaning |
|---|---|---|
| FRESH ZONE | A base and departure completed and price has not returned to the zone | Drawn at full fill and glow for its tier; the area price left, not a level to act on. |
| TESTED ZONE | Price met the zone under the selected Test rule without breaking it | Fill and glow step back, and step back further with each additional test up to the wear limit. |
| BROKEN ZONE | Price closed through the zone under the selected Break rule | The zone is finished and hidden by default; it can never return to tested or fresh. |
| STRONG · STANDARD · WEAK | The construction score crosses a fixed tier threshold at creation | Describes how the zone was built. It is not a ranking of what price will do at the zone. |
| 50% LINE | Show 50% line is enabled and the zone is live or tested | Marks the zone midpoint; a broken zone’s midpoint is history and is not drawn. |
| DATA WINDOW VALUES | Read on every execution from the live close | Distance to the nearest demand zone and to the nearest supply zone, each as a percentage of the current close, plus a zone state of 1 inside demand, -1 inside supply, and 0 outside both. They create, test, break, and prune nothing. |
Settings
The 63-input reference follows the published Preset & theme, Zone detection, Zone lifecycle, Zone grading, Zone body & border, Demand appearance, Supply appearance, Tested & broken appearance, Edge lines, Zone labels, and Zone count table groups. Detection style is the only group that changes what is found; everything below it changes how what was found is drawn.
Preset & theme4 inputs
Swipe or scroll horizontally to see every column.
| Setting | Control | Default | Choices, limits & availability |
|---|---|---|---|
| PresetpresetInput | Choice / text | Signature | Signature · Clean · Minimal · Custom |
| Colour themethemeInput | Choice / text | Signature | Signature · Neon · Muted · Mono · Terminal · Midnight · Ocean · Ember · Paper · Custom |
| Master opacitymasterOpacityInput | Whole number | 100 | Min 5 · Max 100 |
| Glow intensityglowIntensityInput | Whole number | 35 | Min 0 · Max 100 | Conditional |
Zone detection9 inputs
Swipe or scroll horizontally to see every column.
| Setting | Control | Default | Choices, limits & availability |
|---|---|---|---|
| Detection styledetectionStyleInput | Choice / text | Intraday | Scalp · Intraday · Swing · Custom |
| Base max lengthbaseMaxLengthInput | Whole number | 5 | Min 1 · Max 20 | Conditional |
| Base tightnessbaseTightnessInput | Decimal | 1.0 | Min 0.25 · Max 1.5 · Step 0.05 | Conditional |
| Departure strengthdepartureStrengthInput | Decimal | 1.0 | Min 0.25 · Max 5.0 · Step 0.05 | Conditional |
| Zone geometrygeometryInput | Choice / text | Wick | Wick · Body |
| Rally-base-drop (supply)showRbdInput | Toggle | On | — |
| Drop-base-drop (supply)showDbdInput | Toggle | On | — |
| Drop-base-rally (demand)showDbrInput | Toggle | On | — |
| Rally-base-rally (demand)showRbrInput | Toggle | On | — |
Zone lifecycle7 inputs
Swipe or scroll horizontally to see every column.
| Setting | Control | Default | Choices, limits & availability |
|---|---|---|---|
| Break rulebreakRuleInput | Choice / text | Close through | Close through · Wick through |
| Test ruletestRuleInput | Choice / text | Wick touch | Wick touch · Close inside |
| Show tested zonesshowTestedInput | Toggle | On | — |
| Show broken zonesshowBrokenInput | Toggle | Off | — |
| Max zones per sidemaxZonesPerSideInput | Whole number | 10 | Min 1 · Max 18 |
| Max zone age (bars)maxZoneAgeInput | Whole number | 5000 | Min 50 · Max 5000 |
| Flip broken zonesflipBrokenInput | Toggle | Off | — |
Zone grading2 inputs
Swipe or scroll horizontally to see every column.
| Setting | Control | Default | Choices, limits & availability |
|---|---|---|---|
| Grade zonesgradeZonesInput | Toggle | On | — |
| Grade emphasisgradeEmphasisInput | Whole number | 80 | Min 0 · Max 100 | Conditional |
Zone body & border3 inputs
Swipe or scroll horizontally to see every column.
| Setting | Control | Default | Choices, limits & availability |
|---|---|---|---|
| Fill zone bodyfillZoneBodyInput | Toggle | On | — |
| Show zone bordershowZoneBorderInput | Toggle | On | — |
| Emphasise nearest zoneemphasiseNearestInput | Toggle | On | Conditional |
Demand appearance6 inputs
Swipe or scroll horizontally to see every column.
| Setting | Control | Default | Choices, limits & availability |
|---|---|---|---|
| Fill colourdemandFillInput | Color | #00E5FF · 72% transparent | Conditional |
| Border colourdemandBorderInput | Color | #00E5FF · 20% transparent | Conditional |
| Border widthdemandBorderWidthInput | Whole number | 1 | Min 1 · Max 4 | Conditional |
| Border styledemandBorderStyleInput | Choice / text | Dashed | Solid · Dashed · Dotted | Conditional |
| Glow colourdemandGlowInput | Color | #00E5FF · 55% transparent | Conditional |
| Glow spreaddemandGlowSpreadInput | Decimal | 0.5 | Min 0.1 · Max 3.0 · Step 0.1 |
Supply appearance6 inputs
Swipe or scroll horizontally to see every column.
| Setting | Control | Default | Choices, limits & availability |
|---|---|---|---|
| Fill coloursupplyFillInput | Color | #FF2D6F · 72% transparent | Conditional |
| Border coloursupplyBorderInput | Color | #FF2D6F · 20% transparent | Conditional |
| Border widthsupplyBorderWidthInput | Whole number | 1 | Min 1 · Max 4 | Conditional |
| Border stylesupplyBorderStyleInput | Choice / text | Dashed | Solid · Dashed · Dotted | Conditional |
| Glow coloursupplyGlowInput | Color | #FF2D6F · 55% transparent | Conditional |
| Glow spreadsupplyGlowSpreadInput | Decimal | 0.5 | Min 0.1 · Max 3.0 · Step 0.1 |
Tested & broken appearance7 inputs
Swipe or scroll horizontally to see every column.
| Setting | Control | Default | Choices, limits & availability |
|---|---|---|---|
| Tested fill dimtestedFillDimInput | Decimal | 25.0 | Min 0.0 · Max 80.0 · Step 5.0 |
| Tested glow dimtestedGlowDimInput | Decimal | 40.0 | Min 0.0 · Max 80.0 · Step 5.0 |
| Wear per extra testwearPerTestInput | Decimal | 10.0 | Min 0.0 · Max 25.0 · Step 2.5 |
| Tested border colourtestedBorderColourInput | Color | #FFB300 · 20% transparent | — |
| Broken colourbrokenColourInput | Color | #78849A · 60% transparent | Conditional |
| Broken border stylebrokenStyleInput | Choice / text | Dotted | Solid · Dashed · Dotted | Conditional |
| Fade broken zonesfadeBrokenInput | Toggle | On | Conditional |
Edge lines9 inputs
Swipe or scroll horizontally to see every column.
| Setting | Control | Default | Choices, limits & availability |
|---|---|---|---|
| Show proximal edgeshowProximalInput | Toggle | On | Conditional |
| Show distal edgeshowDistalInput | Toggle | On | Conditional |
| Line widthedgeWidthInput | Whole number | 1 | Min 1 · Max 4 |
| Line styleedgeStyleInput | Choice / text | Dashed | Solid · Dashed · Dotted |
| Extend rightextendRightInput | Toggle | Off | — |
| Glow on edge linesedgeGlowInput | Toggle | On | — |
| Show 50% lineshowMidInput | Toggle | Off | — |
| 50% line colourmidColourInput | Color | #B0BEC5 · 35% transparent | Conditional |
| 50% line stylemidStyleInput | Choice / text | Dashed | Solid · Dashed · Dotted | Conditional |
Zone labels8 inputs
Swipe or scroll horizontally to see every column.
| Setting | Control | Default | Choices, limits & availability |
|---|---|---|---|
| Show labelsshowLabelsInput | Toggle | On | Conditional |
| ContentlabelContentInput | Choice / text | Type | Type · Type + age · Type + grade · Type + touches · Age |
| Text sizelabelSizeInput | Choice / text | Small | Tiny · Small · Normal · Large |
| Text colourlabelTextColourInput | Color | #E8EEF5 · 0% transparent | — |
| BackgroundlabelBgColourInput | Color | #0B1520 · 30% transparent | — |
| PositionlabelPositionInput | Choice / text | Right | Left · Centre · Inside · Right |
| Offset (bars)labelOffsetInput | Whole number | 10 | Min -20 · Max 20 |
| Type wordingtypeWordingInput | Choice / text | Rally-base-drop | Supply / Demand · Rally-base-drop · RBD | Conditional |
Zone count table2 inputs
Swipe or scroll horizontally to see every column.
| Setting | Control | Default | Choices, limits & availability |
|---|---|---|---|
| Show zone countshowZoneCountInput | Toggle | Off | — |
| Table text sizetableSizeInput | Choice / text | Small | Tiny · Small · Normal · Large | Conditional |
Alerts and limitations
What can notify you, what can change the output, and what the indicator cannot establish.
4 fixed alert conditions
A drop-base-rally or rally-base-rally zone was created on the current bar.
A rally-base-drop or drop-base-drop zone was created on the current bar.
Price met a live zone under the selected Test rule without closing through it.
Price closed through a live zone under the selected Break rule.
Limits to keep visible
- The indicator describes how an area was constructed from bars that have already printed. It does not predict direction, establish a reaction at a zone edge, or identify an entry, exit, target, or position size.
- Supply and demand here name where a price move originated. The script reads only the open, high, low, close, and volume of the chart in front of it, so it knows nothing about order flow, dealer positioning, or where anyone’s orders actually rest.
- The grade is a construction score, not a quality-of-outcome score. A Strong tier means a tight base and a decisive departure; it does not mean the zone is more likely to hold, and no tier is presented as the one to trade.
- The script makes no request.security() calls and imports no higher timeframe. Everything it finds depends on the symbol, interval, session, and bars supplied by the active data feed.
- Standard time-based candles are assumed. On Heikin Ashi, Renko, or Range charts the engine measures those synthetic values rather than traded prices, so the bases it finds are not the bases on a price chart.
- Base tightness is not a strictness dial. The zone count peaks in the middle of its range and falls away at both ends, so loosening it past the peak draws fewer zones rather than more.
- Detection requires ATR(14) history before anything can be measured, so the opening bars of a chart produce no zones regardless of what they look like.
- Drawing history is finite. Every glow layer, edge line, and label spends from budgets of 500 boxes, 500 lines, and 100 labels, so Max zones per side and Max zone age bound what can be kept rather than being preferences alone.
- Zone geometry is fixed once created and only its lifecycle state changes, on closed bars. The published build carries compiler and owner-confirmed render evidence rather than a completed replay-and-reload study, so confirm behavior with Bar Replay on your own symbol and timeframe.
- Alert creation and script conditions do not guarantee delivery. TradingView plan limits, chart execution, network state, and notification settings remain outside the script.
Troubleshooting
Start with what you see on the chart. Each answer explains the likely cause and the first setting, timeframe, or data condition to check.
Why are there no zones on my chart?
Check the timeframe first. A zone needs a completed base and a completed departure, and that pattern completes far more often on a fast chart, so a 5-minute or lower interval gives the most to read. Also confirm enough history is loaded for ATR(14) to exist, since the opening bars of a chart produce nothing.
Why did loosening Base tightness draw fewer zones?
That is the expected behavior, not a fault. A looser limit lets tight runs grow past Base max length, and a run longer than that is rejected as a range rather than trimmed to fit. The zone count peaks in the middle of the range and falls away at both ends, which is why the range stops where it does.
Why did a strong-looking move not create a zone?
The departure is measured on the close, never the high or low. A bar that spikes past the base and closes back inside it draws nothing. The threshold is also measured against the previous bar’s ATR, so a wide departure bar does not raise its own requirement.
Why do my zones all look the same?
Check Grade emphasis and Glow intensity together. At an emphasis of 0 every zone draws alike, and below 76 two tiers share a halo stack, so the shipped 80 sits just clear of that edge. If Preset is Custom, a Glow intensity below about 25 also stops the grade showing through the halo.
Why did the edge lines disappear when I turned the border off?
Show zone border removes the box outline and both edge lines together. The two edge switches stay lit but do nothing while it is off. The 50% line is unaffected, because it is a level rather than part of the box.
Why is the chart suddenly crowded?
Show broken zones is the usual cause; keeping broken zones roughly triples what is drawn. Raising Max zones per side helps less than it looks, because most zones end broken and those ship hidden. Reduce the cap or the maximum age rather than raising them.
Why did a zone change type?
It did not. Flip broken zones draws a new zone of the opposite type at the same levels when a zone breaks, and the broken zone stays broken. Nothing already on the chart changes what it claims to be, and a flipped zone never flips again.
Why does a tested zone keep fading?
Wear per extra test takes a further percentage off fill and glow for each test after the first, stopping after four extra tests. The grade itself is frozen and still describes formation. Set Wear per extra test to 0 to turn the effect off.
Why do the colors look wrong on a light chart?
Eight of the nine themes are built for a dark background. Choose the Paper theme for a light chart, or Custom to set the six pickers yourself. Master opacity fades every color together without changing any individual setting.
Why did an existing alert keep the old behavior?
TradingView alerts retain the symbol, timeframe, and input snapshot they were created with. Delete and recreate the alert after changing detection style, lifecycle rules, timeframe, or symbol, then verify the new condition in the alert dialog.