Supply and Demand Trading Strategy: Zone Rules

A supply and demand trading strategy marks price ranges before a strong departure, then tests how price behaves on a later return. A demand zone precedes an upward departure; a supply zone precedes a downward one. A usable strategy must state when the zone becomes known, what counts as its first touch, and when it expires. A rectangle drawn on an old candle does not prove that a trader could have acted there.

Build a supply and demand strategy

Key Takeaways

  • Freeze a zone only after its formation rule confirms; record both its origin and confirmation time.
  • Define a touch, an entry signal, and an invalidation separately. They can occur on the same bar.
  • First-touch rules select a sample to test; they do not establish that fresh zones are more profitable.
  • Resolve overlapping supply and demand zones before reviewing outcomes.
  • Price zones do not reveal the identity or remaining orders of institutional traders.

What a supply or demand zone can tell you

A zone records a price pattern: a base followed by a directional departure. Using it as a future reaction area is a hypothesis. OHLC candles alone cannot show who traded, whether a large order remains unfilled, or whether a later bounce will occur. TradingView describes its Depth of Market as a separate view of orders at different prices, using broker data. A zone inferred from candles is not an order-book measurement. Support and resistance can also be drawn as areas. The useful distinction is how the boundaries are chosen: the example below uses the complete range of a fixed base before departure, rather than selecting a level after seeing repeated reactions.

Define the base and the confirmation bar

The following is an illustrative specification for standard OHLC candles on one fixed timeframe. Its three-bar base and volatility thresholds are test assumptions, not universal supply and demand rules. Wait until the 14-period ATR is available. Use its value at the close immediately before the departure candle; do not recalculate the threshold with the departure itself.

A reproducible zone formation rule
ElementDemand zoneSupply zone
Base and boundariesThe three completed candles immediately before departure. Lower edge = their lowest low; upper edge = their highest high.Use the same three-candle high and low definition.
Base widthUpper edge minus lower edge must be positive and no greater than 2 times the preceding ATR.Apply the same width filter.
DepartureA bullish candle closes above the upper edge; its body is at least 1.5 times the preceding ATR.A bearish candle closes below the lower edge; its body is at least 1.5 times the preceding ATR.
AvailabilityConfirm at the departure close. Freeze the boundaries; count revisits only from the next bar.Use the same confirmation and activation timing.
  • The origin is the first base candle. The confirmation time is the departure close. Store both.
  • Do not widen a stored zone after a later wick, or redraw its base to improve historical results.
  • If several zones qualify, give each its own identifier and lifecycle. A new zone does not reset an older zone to fresh.

Separate first touch, rejection, and invalidation

In this experiment, a revisit is the first later candle whose range intersects the frozen zone, including an exact boundary touch. For demand, an intact first-touch bar must have its low at or above the lower edge. A close above the upper edge on that same bar confirms the long signal. For supply, the high must stay at or below the upper edge and the close must finish below the lower edge. Evaluate invalidation first. Any low below a demand zone or high above a supply zone invalidates that zone, even if the candle later recovers. This also rejects a gap entirely through the zone. A wick-based rule is deliberately stricter than a close-based rule; compare them as separate experiments instead of switching after a loss.

  • Count the first touch as consumed even if rejection fails, another position is open, or a conflict blocks the trade. A later bounce is not a new first touch.
  • Allow at most one entry per zone, only while flat. When several same-side zones signal on the same bar, select the most recently confirmed one.
  • Every zone expires after the close of its 50th subsequent bar. Evaluate that final bar before expiring it. Until expiry or invalidation, a consumed zone remains an opposing-zone reference but cannot trigger another entry.
  • A broken zone is retired. Trading it in the opposite direction requires a separately defined setup, not an automatic polarity flip.

A first revisit you can audit bar by bar

These prices are hypothetical and demonstrate rule decisions, not market performance. Assume a three-candle base with a combined low of 100 and high of 102, and a preceding ATR of 1. The base width of 2 meets the filter. A departure from an open of 101.8 to a close of 103.5 has a body of 1.7 and confirms demand at that close. No position or competing zone is present.

Illustrative demand zone: 100 to 102
EventObserved pricesDecision
Base candlesCombined low 100; combined high 102Candidate origin only. No confirmed demand zone yet.
Departure closesOpen 101.8; close 103.5Freeze 100 to 102. The departure cannot count as its own revisit.
Next barLow 102.4; high 104; close 103.2No touch. The entire bar remains above the zone.
Following barLow 101.6; high 103.3; close 102.6First touch and rejection signal at the close; mark the zone consumed.
A later returnLow 101.4; high 103; close 102.5No new entry from this zone. Its first touch was already used.
  • Alternative first-touch bar: low 101.6 and close 101.9 consumes the visit without a long signal.
  • Alternative first-touch bar: low 99.8 and close 102.6 invalidates demand. The recovery does not override the boundary breach.
  • The table ends without a trade outcome; it supplies no win rate, return, or evidence that the thresholds are useful.

What to do when supply and demand zones conflict

For this test, skip an entry when its zone overlaps any active opposite-side zone. Include shared boundaries as overlap. Active means not expired or invalidated, even if already touched. Check zones confirmed before the current bar, after applying that bar's invalidations and before recording new touches. The touch is still consumed if the trade is skipped. This is a conflict policy chosen in advance, not evidence that one timeframe or direction is superior. Consider a hypothetical demand zone from 100 to 102 and an active supply zone from 101.5 to 104. A first-return candle with low 101.6, high 103.3, and close 102.6 satisfies the demand rejection rule and leaves supply intact. The zones overlap from 101.5 to 102, so the policy skips the long. Selecting demand only because the next candle rallied would change the rules with hindsight.

  • Keep the skipped setup in the record, including both zone identifiers and their confirmation times.
  • A different policy might prioritize a higher timeframe, but it must specify which timeframe and use only its already-confirmed zones.
  • Supply above a demand zone can limit room for a target even without overlap. Measure that distance separately rather than assuming every valid rejection is tradable.

Confirmation time and fill time are different

TradingView documents that unfinished high, low, and close values can change, and that pivot markers drawn on past bars can hide the delay needed to confirm them. A zone indicator using a pivot with three right-side bars cannot use that pivot three bars earlier. Show the confirmation marker separately from the rectangle's origin. Waiting for a close resolves unfinished-bar decisions, but is not a blanket guarantee against repainting. With default strategy calculation, an order created at a bar close can normally first fill at the next bar open. The 102.6 close in the example is therefore a signal price, not an assumed execution price. Include commission and slippage, and inspect historical bars where both a stop and a target fall inside the range; OHLC alone does not show every intrabar price sequence.

  • Before running a performance test, add position size, protective stop, target, time exit, and gap handling to the zone rules.
  • For a long, a stop below the lower edge defines a planned risk distance; a gap can still produce a larger loss.
  • Keep all expired, invalidated, and consumed zones in the event log. Deleting failed rectangles makes retrospective chart review misleading.

Test revisit outcomes and review the generated strategy

A supply demand trading strategy needs two records: zone events and executed trades. Log formation, first touch, rejection, conflict, expiry, and invalidation for every zone. Separately measure the trades after costs. Compare rules on the same symbol, session, timeframe, and date range, then evaluate a later period that was not used to choose the settings. A first-touch filter can reduce the sample; report how many zones never traded. Pine Script AI Coding Agent can draft the zone lifecycle and entry logic from these definitions. Ask it to preserve origin and confirmation times, then check the output against the hypothetical cases before running a backtest. Backtest Deep Report analyzes an exported TradingView trade list and can export an Excel workbook. It can help assess executed revisit trades, but a trade CSV cannot reconstruct untouched zones or skipped signals; retain that event log alongside the report.

Pineify next step

Encode the zone lifecycle before testing returns

Give Pine Script AI Coding Agent your formation, first-touch, conflict, and invalidation rules, plus complete trade exits and sizing. Review the generated strategy in TradingView against known cases before interpreting its results.

Educational information, not investment advice. All numerical examples and rule thresholds are hypothetical and do not demonstrate profitability. Trading involves loss risk; gaps and execution costs can exceed planned losses. Historical or simulated results do not guarantee future performance.

Frequently Asked Questions